cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Forms, XML(PDF format) to PDF binary

Former Member
0 Kudos

Hi experts!

I'm working with Interactive Adobe Forms and the form function return the PDF in a XML format (xstring) through the parameter FPFORMOUTPUT-XML.

I need to save the PDF file (binary) without geting it through the "getpdf" parameter FPFORMOUTPUT-PDF.

Because the "getpdf" don't permit to show the user dialog print options.

How could I transform the XML(PDF) returned in binary PDF file?

Thank you all!

Accepted Solutions (0)

Answers (1)

Answers (1)

SandySingh
Active Contributor
0 Kudos

Hello Evaristo

You can make use of CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' and CALL METHOD cl_gui_frontend_services=>gui_download to achieve this requirement.

Regards

Sandy


CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

               EXPORTING

                 buffer        = ls_params->es_output-s_form_output-xml

               IMPORTING

                 output_length = lv_pdf_len

               TABLES

                 binary_tab    = lt_pdf.

             lv_file_name = p_xml.

            


CALL METHOD cl_gui_frontend_services=>gui_download

               EXPORTING

                 bin_filesize = lv_pdf_len

                 filename     = lv_file_name

                 filetype     = 'BIN'

               CHANGING

                 data_tab     = lt_pdf

               EXCEPTIONS

OTHERS       = 1.

Former Member
0 Kudos

Hello Sandy!

Thank you for your post!

I already try this way but, the problem is, I'll be only converting the XML file to

binary and saving the file. When I try to open the PDF file, its corrupted! Because it's a XML file and not a PDF file.

I need convert the XML to PDF, convert to binary and save the file.

Any suggestions?

Thank you!

BR,

Evaristo.

SandySingh
Active Contributor
0 Kudos

Hello Evaristo,

You can use following FM

TEXT_CONVERT_XML_TO_SAP   ---  to transfer XML to internal table

CONVERT_OTF                                  ---  internal table to convert to PDF

Regards

Sandy

SandySingh
Active Contributor
0 Kudos

Hello Evaristo,

I found a sap standard class that converts the XML to PDF

CL_CO_XMLTOOL=>CONV_XML_TO_PDF

Hope it helps

Regards

Sandy