08-12-2016 11:40 AM
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.
08-12-2016 12:24 PM
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).