Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error while opening PDF after generation

Hello,

 

I have a job whose task is to download a list of PDFs in Salesforce by using an attachment ID. The PDFs are being downloaded, however while opening them I'm getting the error:

0683p000009LtCI.png

 

While opening the PDF via Notepad++ I'm seeing Base64 String.

0683p000009LtKG.png

 

While decoding the said Base64 string in an online Base64 to text converter, I'm getting the correct version of the PDF to download and it can be opened correctly.

 

Here is the job design:

0683p000009LtE0.png

 

The code in the tJavaRowComponent is:

0683p000009LsxB.png

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello xdshi,

 

Thank you for your reply.

 

The issue I was encountering was that I was unable to decode a byte array directly to Base64 due to the fact that I was forced to use the library sun.misc.BASE64Decoder as Talend 6.4.1 wasn't compiling my code was I tried to use java.util.Base64

 

To solve it, I had to write the Base64 String to a text file via a tJavaRow, and then read the saved text via another tJavaRow and tFileList and decode it from said Base64 String to get my PDF.

 

Thank you for your involvement.

 

Kind regards.

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hello,

Have you tried to use a custom component tFileOutputPDF which is written by talend community user and shared on talend exchange portal?

Best regards

Sabrina

 

Anonymous
Not applicable
Author

Hello xdshi,

 

Thank you for your reply.

 

The issue I was encountering was that I was unable to decode a byte array directly to Base64 due to the fact that I was forced to use the library sun.misc.BASE64Decoder as Talend 6.4.1 wasn't compiling my code was I tried to use java.util.Base64

 

To solve it, I had to write the Base64 String to a text file via a tJavaRow, and then read the saved text via another tJavaRow and tFileList and decode it from said Base64 String to get my PDF.

 

Thank you for your involvement.

 

Kind regards.