cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong layout converted from sapscripts to PDF

former_member337526
Participant
0 Kudos

Hello SAP guru.

1. I have sapscript Z layout and I was required to convert and download this sapscript layout to PDF file. ( Not SPOOL !!!! )

2. To approach this I have used FM

CALL FUNCTION 'CLOSE_FORM'

TABLES

OTFDATA = DATAB[]

and then

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

IMPORTING

BIN_FILESIZE = BINFILESIZE

TABLES

otf = DATAB[]

lines = PDFTAB[]

and

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = binfilesize

FILENAME = 'D:\myfile.pdf' ( here, instead of 😧 I download the file into network system - not local PC )

FILETYPE = 'BIN'.

the file has been created successfully, BUT

there are number of problems in created PDF file:

1. font differs from sapscripts font

2. data has been slided out of PDF form

3. lines slided out of PDF form

Please, advice how I can solve the problems.

Thanks,

regards,

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Give it a try with the code below for the transfer from your pdf-tab to the file


    PERFORM download_w_ext(rstxpdft) TABLES pdf_tab
                                     USING p_file
                                           '.pdf'
                                           'BIN'
                                           binfilesize
                                           cancel.

former_member337526
Participant
0 Kudos

Hi Tom , Aidan

Thanks for your response.

I have no opportunity to check your suggestions - I'll check it tomorrow and will update you.

Regards,

Daniel.

former_member337526
Participant
0 Kudos

Hi Tom,

I have tryed the PERFORM you advised - a file has been created, but

he has size 10 times less then before and I can't open it at alll - I got nesssage

that the file can't be opend because of either have not supported format or is damaged.

Please, advice,

Daniel

Answers (2)

Answers (2)

former_member337526
Participant
0 Kudos

Hi Tom and Aidan.

finally I have solved the problem.

I have used NEU standard layout as basis to create a spool and then I have used the programs that you adviced to convert and create PDF file.

Thanks a lot for your assistance.

Regards,

Daniel

aidan_black
Active Contributor
0 Kudos

Hi Daniel,

There will be some slight differences when converting to DF versus printed output. For print, the internal printer fonts are used. For PDF, the Adobe eader fonts are used. But from your description, it sounds like more than this.

Can you try the following test. Create a spool for print. Convert this created spool number to a PDF file via report RSTXPDFT4. Does the PDF created this way still look very different to the printed output?

Regards,

Aidan

former_member337526
Participant
0 Kudos

Hi Aidan

I'm not very experienced with spool creating.

during the print process we aren't creating a spool.

I have no idea for a while how to cause this program to create a spool,

so I can't implement your suggestions.

Please, advice.

Daniel.

aidan_black
Active Contributor
0 Kudos

Hi Daniel,

If you turn the option 'SAVE_OTF_SPOOL' to 'On' via the report 'RSTXPDF3', then a spool should be created. See SAP note #924752 about this.

So you need to set this option and then create a new PDF. You then can see the created spool in SP01. Then convert this spool to PDF via RSTXPDFT4.

If this works thent he OTF data is ok and the problem is with your code to convert to PDF.

Regards,

Aidan

former_member337526
Participant
0 Kudos

Hi Aidan,

I could check it just at next sunday,

thanks a lot for your advice.

Regards,

Daniel.