<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fetch PDF document and convert it to Base64 in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370400#M133449</link>
    <description>&lt;P&gt;Hi Jeremy. Thanks again. How can I read that input stream? With a tFileInputDelimited?  Thanks in advance. &lt;/P&gt;</description>
    <pubDate>Wed, 13 Oct 2021 00:03:56 GMT</pubDate>
    <dc:creator>MRoldan1633480871</dc:creator>
    <dc:date>2021-10-13T00:03:56Z</dc:date>
    <item>
      <title>Fetch PDF document and convert it to Base64</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370396#M133445</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi all. Im kind of newbie in all these things. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get a document from a URL with a parameter (e.g. http://localhost?id_document=1, &lt;/P&gt;&lt;P&gt; http://localhost?id_document=2&lt;/P&gt;&lt;P&gt;). I used the tFetchFile componente, but I did not find how to pass the query param to identify the document. Can someone help me? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I need to convert that file to base64. Does anybody know what component I should use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 00:54:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370396#M133445</guid>
      <dc:creator>MRoldan1633480871</dc:creator>
      <dc:date>2021-10-06T00:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch PDF document and convert it to Base64</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370397#M133446</link>
      <description>&lt;P&gt;HI @Maxi Roldan​&amp;nbsp;, you can format directly you URI in tfileFetch : "&amp;nbsp;&lt;A href="http://localhost/?id_document=1" alt="http://localhost/?id_document=1" target="_blank"&gt;http://localhost?id_document=&lt;/A&gt;" + global var of your id.&lt;/P&gt;&lt;P&gt;The you can use a tFileList on the local folder you store the document,&lt;/P&gt;&lt;P&gt; then you can use this routine for example to transform the content into base64 with the file path from tFileList :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;package routines;&lt;/P&gt;&lt;P&gt;import java.nio.file.Files;&lt;/P&gt;&lt;P&gt;import java.nio.file.Paths;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;public class File_managing {&lt;/P&gt;&lt;P&gt;public static String base64FromFile(String filepath) {&lt;/P&gt;&lt;P&gt;try{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;byte[] incoming_file_data = Files.readAllBytes(Paths.get(filepath));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return Base64.encode(incoming_file_data);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;catch(Exception err){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;err.printStackTrace();return null;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Send me Love and Kudos&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 07:40:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370397#M133446</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-10-07T07:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch PDF document and convert it to Base64</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370398#M133447</link>
      <description>&lt;P&gt;Hi Jeremy. Many thanks for your answer! It was really helpful. I need to convert the file without saving it on disk. Do you know how I can di this? Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 16:21:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370398#M133447</guid>
      <dc:creator>MRoldan1633480871</dc:creator>
      <dc:date>2021-10-11T16:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch PDF document and convert it to Base64</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370399#M133448</link>
      <description>&lt;P&gt;HI, you can use &lt;B&gt;Use cache to save the resource on the tfilefetch to store the file on an input stream.&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Send me Love and Kudos&lt;/B&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 11:11:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370399#M133448</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-10-12T11:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch PDF document and convert it to Base64</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370400#M133449</link>
      <description>&lt;P&gt;Hi Jeremy. Thanks again. How can I read that input stream? With a tFileInputDelimited?  Thanks in advance. &lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 00:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370400#M133449</guid>
      <dc:creator>MRoldan1633480871</dc:creator>
      <dc:date>2021-10-13T00:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch PDF document and convert it to Base64</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370401#M133450</link>
      <description>&lt;P&gt;you can try something like this to get the byte[] from input stream:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ByteArrayOutputStream out = new ByteArrayOutputStream();&lt;/P&gt;&lt;P&gt;byte[] buffer = new byte[1024];&lt;/P&gt;&lt;P&gt;while (true) {&lt;/P&gt;&lt;P&gt;    int r = ((java.io.InputStream)globalMap.get("tFileFetch_1_INPUT_STREAM"))).read(buffer);&lt;/P&gt;&lt;P&gt;    if (r == -1) break;&lt;/P&gt;&lt;P&gt;    out.write(buffer, 0, r);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;byte[] ret = out.toByteArray();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then you convert to base 64&lt;/P&gt;&lt;P&gt;Send me love and kudos&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 07:50:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-PDF-document-and-convert-it-to-Base64/m-p/2370401#M133450</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-10-14T07:50:34Z</dc:date>
    </item>
  </channel>
</rss>

