Application Development 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: 

MS Office Current Formats to PDF conversion

Former Member
0 Kudos

A bit of a stretch for the forum, probably, but I'll ask.

I'm using a web service to convert uploaded MS Office files to PDF. To do that, I convert my binary table to an xstring, call my webservice supplying the xstring, and get back a converted XSTRING that goes back into a binary table.

This works perfectly for "old" MS Office formats, like .doc, .xls, etc. But, it always fails (No renditions) for .docx, .xlsx., etc.

My question is: is anyone aware of any requirement to format internal tables, xstring, etc., created from uploaded docx, xlsx, etc., files differently for software that does a PDF conversion? I don't have any documentation or insight into what the web service does for me... so just asking if anyone is aware of any changes that have to be considered for say, doc vs. docx files.

An update: from research, I see that docx, xlsx, etc., are stored in Open XML format as opposed to binary format.

Update: Open XML is very unforgiving when it comes to lengths. To work with the files as an xstring, one must use precisely the length of the file. This is not true of the older MS Office binary formats....so, here are my solution steps:

gui_upload into binary table (gl_gui_frontend_services)

get the file size (cl_gui_frontend_services)

call method cl_gui_cfw=>flush to receive the file length value.

convert the binary table to xstring with FM 'SCMS_BINARY_TO_XSTRING', with input_length parameter = file size from step 2.

if the length of the xstring is = file length.

call the webservice, supplying xstring and getting back a converted-to-PDF xstring.

put converted xstring back into binary table with FM 'SCMS_XSTRING_TO_BINARY'

proceed with my archival storage into documentum.

1 REPLY 1

denner_boaventura
Discoverer
0 Kudos

you could post the code?