Support Article
MergePDF is diaplayed in Unreadable format
Summary
User have a scenario in their application, where by selecting the required documents and share via service and receive a single merge document.
The received document is converted into PDF and displayed on screen.
The above scenario is working fine in Internet Explorer, whereas the same is not working in Chrome and Firefox browsers.
Error Messages
In Chrome and Firefox browsers, the merge PDF is displayed as an unreadable format.
Steps to Reproduce
1. Create a button. On button click show the popup window with required documents and share via service and receive a single merge document.
2. Run the Activity for downloading the merged document.
3. Write the logic for converting byte array to PDF.
Root Cause
File name with ".pdf" extension is missing hence the issue occurred.
User appended the ".pdf" to the filename resolves the issue.
Resolution
Perform the following local-change:
1.Add below code snippet in step 7 of Activity : DownloadSelectedMRTDocument.
try
{
byte[] ByteArray= Base64Util.decodeToByteArray(inputStream);
String FileName=fileName + ".pdf";
String Response=tools.sendFile(ByteArray,FileName,false,null,false);
}
catch(Exception e)
{
}
2. Save the Activity and Run.
Published December 4, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.