Conversion binary->text to a PDF file with Talend Open Studio Data Integration

Highlighted
Six Stars

Conversion binary->text to a PDF file with Talend Open Studio Data Integration

Hi,

 

I’m new in Talend and I have an issue. I want to extract a PDF file of a postgresql server (Blob column) and transform the binary file in a text file with Talend Open Studio to read the contain of the PDF file.

I will explain my way now :

This is my postgresql table.

 

Table name : attached_file

 

id;name;mime_type;data

1;TEST_report_1.html;text/html;<binary data>

2;pdffile1.pdf;application;<binary data>

 

I extracted the file with the SQL request :

 

COPY (SELECT data FROM attached_file WHERE id = 2) TO ‘D:/_users/BMI/testpdf.txt’ (FORMAT binary);

 

I heard that to open the binary file, I must use a tFileInputRaw composant with the “Read the file as a bytes array” mode. However, I’m blocked for the output to create the final file.

 

Regards,

Bastien


Accepted Solutions
Six Stars

Re: Conversion binary->text to a PDF file with Talend Open Studio Data Integration

Hi,

Thank you for your answer. I read that.

Bastien


All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Conversion binary->text to a PDF file with Talend Open Studio Data Integration

Hi,

You need to go with a tJavaXxxx component for this purpose (I think so).

Search for "java convert binary to pdf" with Google, it will give you some examples:

http://stackoverflow.com/questions/1131116/pdf-to-byte-array-and-vice-versa

http://myjavaprogramming.blogspot.fr/2011/09/convert-byte-array-to-pdf-in-java.html

 


TRF
Six Stars

Re: Conversion binary->text to a PDF file with Talend Open Studio Data Integration

Hi,

Thank you for your answer. I read that.

Bastien

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads