Skip to Content
author's profile photo Former Member
Former Member

PDF File is damaged and could not be repaied.

Hi,

We are facing an issue displaying PDF in GUI HTML Viewer. We face this issue when we display pdf in UDM_SUPERVISOR transaction. Generated PDF xstring data is converted and passed as RAWSTRING table to FM FDM_COLL_INV_PDF_SHOW.

1) Generated PDF data(Custom Adobe FORM) is not in multiple of 1024 bits. Hence while converting XSTRING to BINARY using FM SCMS_XSTRING_TO_BINARY, trailing zeroes are added to last row of BINARY table.

2) When this is passed to HTML viewer, file is downloaded to TEMP folder with additional null data after EOF(End of file). Hence file is not opening in Adobe Reader. However I could see the PDF using other PDF renderers like Microsoft Reader and Chrome browser.

Question:

1) Is this issue with ADS - Should it always generate PDF which is multiple of 1024 bit(1 Kilo bit).

2) Is this issue with HTML Viewer that it should ignore trailing zeroes in BINARY table.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 12, 2016 at 11:24 AM

    No, a PDF can be of any size, and it should be considered a bug if an application adds extra bytes (as often discussed in the web) because some PDF viewers may not work (it's not a bug if an application can't read a malformed PDF).

    When you pass the internal table to the HTML viewer, you must pass the number of bytes of the original XSTRING along with the internal table (so that its extra bytes are not passed to the HTML viewer).

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.