Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert Binary to OTF

Former Member
0 Likes
9,766

Hi All,

We have a function module 'CONVERT_OTF' to convert OTF table to binary PDF table.

Do we have any function module for the reverse, to convert Binary PDF table to OTF format?

Thanks,

Amit gaba

22 REPLIES 22
Read only

Former Member
0 Likes
4,852

hi Amit,

Check with Se37 by SCMS_BINARY_TO* and press F4 you will get

the function from binary to there respective formats.

Cheers!!

VEnk@

Read only

0 Likes
4,852

Hi,

I did not find any FM to convert to OTF there.

Thanks,

Amit

Read only

0 Likes
4,852

Hi,

Can you tell the purpose why you are converting binary to OTF is there any special reason for that ?

Read only

0 Likes
4,852

I dont think there is any FM avaliable to convert PDF binary format to OTF

Read only

0 Likes
4,852

Hi,

I want to merge two pdf documents into 1 pdf documents. You can do this if you have data in OTF format. Not sure if it is possible by any other way so was thinking if there is a way to convert PDF to otf format.

We have a standard FM to convert OTF to PDF so i thought there must be something to do the reverse.

Thanks,

Amit Gaba

Read only

0 Likes
4,852

Hi Amit,

it can be done by converting PDF to OTF and create spool in then you merge spools . After you get the single spool pass the spool

gv_spool = 'sigle spool'

p_file = going to save the file.

" submit rstxpdft4

with spoolno = gv_spool

with p_file = p_file

and return."

Thanks,

Harikiran

Read only

0 Likes
4,852

Hi Harikiran,

How do we convert PDF to OTF? I have not found any function to convert PDF to OTF yet.

How do we merge two spools?

Please let me know if you have done this conversion?

Thanks,

Amit

Read only

0 Likes
4,852

Hi Amit, <li> You need to explain where you are struck. What object you are working on? Working on Smartfrom? <li> First of all how are you getting PDF data to convert to OTF? <li> You need to explain your real requirement? Thanks Venkat.O

Read only

0 Likes
4,852

Hi Venkat,

I am creating a PDF document using Adobe forms.

My actual requirement was to embed contents of different word documents dynamically inside the adobe form which i came to know was not possible because microsoft word documents have different format as compared to PDF document.

So, i was thinking of converting word document into PDF and instead of embedding it into my adobe form pdf just merging it with the PDF created.

Now, the problem here was i get the pdf document in binary format inside my program and i need it in some different format which can be understood and merged. OTF format was a good option since we can merge two different documents if they are in OTF format.

Thanks,

Amit

Read only

0 Likes
4,852

Hi Amit,

Follow the link to convert to binary.

to read the file.

Read only

0 Likes
4,852

Hi Harikiran,

I already have the PDF as binary table with me so i am not looking for converting PDF to binary but i am looking for converting binarty to OTF.

Thanks,

Amit

Read only

0 Likes
4,852

Hi,

I dont think there is any function moddule available for this.

But some work arounds could be tried.

Try appending all the binary data into an internal table.

Try converting the Binary data to text using FM SCMS_BINARY_TO_TEXT (MArk APPEND_TO_TABLE = 'X').

Then try writing that internal table as it is as list output into spool and then convert to pdf.

Check this link for writing to spool link:[https://wiki.sdn.sap.com/wiki/display/ABAP/PDFDownlaodByCreatingSpool+Request]

Im not sure how far this will work. Just give a try

Read only

0 Likes
4,852

Hi Keshu,

I have tried this but it does not work. When you convert PDF to binary it also stores the begin and end tag of pdf at the start and end of the table and if you append another pdf table then it comes after the end tag and does not get displayed in the table.

Since data is in hexadecimal format we can not understand where these tags start and end so can not insert the other pdf between those tags.

Thanks,

Amit

Read only

0 Likes
4,852

Hi Amit,

I have one question now your converting word document to pdf why? is there any form(media) to print in PDF...

or just your thinking to convert workd doc to PDF, Then convert PDF to OTF?

Thanks,

Hari

Read only

0 Likes
4,852

Hi Hari,

My actual requirement was to merge word and pdf but since both have a different format so thought of converting word to pdf and then merge them.

Converting word to pdf is not an issue. I think this should be possible the main issue is of merging two pdf documents.

Thanks,

Amit

Read only

0 Likes
4,852

hi amit i think this thread will be quiet promising

Read only

0 Likes
4,852

Hi Amit,

For merging 2 or more different pdf documents into a single one you can refer the following links

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/404e4dc1-a79c-2d10-a7b5-9a266dfed9cb?QuickLink=index&overridelayout=true]

[;

Thanks,

Renuka S.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
4,852

Hi Amit

Still not solved ?

just check with this.

you can get the xstring format of pdf .

for each pdf concatenate the xstring in byte mode.

and then check if there is any FM for conversion.

MEan while i will check if there is any other solution available.

just want to know whether you are using adobe forms or generating pdf any other way ?

Your exact requirement ?

Read only

Former Member
0 Likes
4,852

hi

check the link ** http://help.sap.com/search/highlightContent.jsp **

thanks and regards

Dhruv Kakkar

Read only

Former Member
0 Likes
4,852

Hi ,

You can transfer pdf file to internal table then you can do anything... by using internal table.

see below link... it will work fine.

Thanks,

Hari

Read only

Former Member
0 Likes
4,852

Hi Amit,

I found one you can download to your PC as a PDF.

But you need to convert PDF to binary both files and append each then convert pdf download in local drive.

report zfile_access.

data : g_path(128),

t_path type string.

data : begin of gt_lines occurs 0,

line type x,

end of gt_lines.

data : lt_value like tline occurs 0 with header line.

g_path = 'P:\FEMS_ABC\2850_specs.pdf'.

t_path = 'c:\temp\2850_specs.pdf'.

open dataset g_path for input in binary mode.

if sy-subrc = 0.

clear : lt_value.

refresh : lt_value.

do.

read dataset g_path into gt_lines-line.

if sy-subrc = 0.

append gt_lines.

else.

exit.

endif.

enddo.

endif.

close dataset g_path.

you append both binary files in gt_lines and download to t_path(.pdf) it will show nice pdf format.

call function 'GUI_DOWNLOAD'

exporting

filename = t_path

filetype = 'BIN'

tables

data_tab = gt_lines[].

Read only

0 Likes
4,852

Hello,

Have you resolved the problem? i have the same requirement as yours, If you already solved the issue, could you share the solution with me? Thanks a lot!

Best Regards,

Ivy