<?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: pdf file attachment into XML message in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318197#M88563</link>
    <description>&lt;P&gt;@Shicong Hong​&amp;nbsp;Could you please suggest. I have taken that pdf into trowgenerator then tMap and assigning the value into it, Is it good or any better option for this.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2021 11:17:03 GMT</pubDate>
    <dc:creator>mani1304</dc:creator>
    <dc:date>2021-01-13T11:17:03Z</dc:date>
    <item>
      <title>pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318190#M88556</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to attach a pdf file into an XML message to push into queue, can someone suggest on it, I got one piece of code to first convert it into base64 then to push in java but not getting on how to implement it or some other way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import java.io.File;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import java.nio.file.Files;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import java.util.Base64;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class Test {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;public static void main(String[] args) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;try {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;File file = new File("C:\\\\Users\\\\ngargp8\\\\Desktop\\Power DataSync.pdf");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte [] bytes = Files.readAllBytes(file.toPath());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;String b64 = Base64.getEncoder().encodeToString(bytes);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(b64); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;} catch (Exception e) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;e.printStackTrace();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&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;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 12:21:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318190#M88556</guid>
      <dc:creator>mani1304</dc:creator>
      <dc:date>2021-01-11T12:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318191#M88557</link>
      <description>&lt;P&gt;In talend, you can hard code on tJava or write a user routine to implement the function. &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;For example, on tJava:&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;in the basic setting panel：&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;try {&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;File file = new File("D:/shong/files/3.txt");&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;byte [] bytes = Files.readAllBytes(file.toPath());&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;String b64 = Base64.getEncoder().encodeToString(bytes);&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;System.out.println(b64);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;} catch (Exception e) {&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;e.printStackTrace();&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;in the advanced settings panel.&lt;/P&gt;&lt;P&gt;import java.io.File;&lt;/P&gt;&lt;P&gt;import java.nio.file.Files;&lt;/P&gt;&lt;P&gt;import java.util.Base64;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 12:32:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318191#M88557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-11T12:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318192#M88558</link>
      <description>&lt;P&gt;Thanks @Shicong Hong​&amp;nbsp;, but I think from this way I can convert it to Base64, but how can I attach it with an XMl message. something like tUnite or something else.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 12:37:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318192#M88558</guid>
      <dc:creator>mani1304</dc:creator>
      <dc:date>2021-01-11T12:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318193#M88559</link>
      <description>&lt;P&gt;You  can store the value to a context variable for used on other component later .&lt;/P&gt;&lt;P&gt;try {&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;File file = new File("D:/shong/files/3.txt");&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;byte [] bytes = Files.readAllBytes(file.toPath());&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;String b64 = Base64.getEncoder().encodeToString(bytes);&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;context.varName=b64;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;System.out.println(b64);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;} catch (Exception e) {&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;e.printStackTrace();&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 03:17:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318193#M88559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-12T03:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318194#M88560</link>
      <description>&lt;P&gt;Thanks @Shicong Hong​&amp;nbsp;, but sorry I didn't get it, how can I add this in my xml fie, I have created an XML file via tfileOutputMSXML via merging 4 files flow, now I want to add this pdf into it also. I will take this pdf's base64 value in context variable, not how can I add it in my XML file.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 12:54:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318194#M88560</guid>
      <dc:creator>mani1304</dc:creator>
      <dc:date>2021-01-12T12:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318195#M88561</link>
      <description>&lt;P&gt;Before tfileOutputMSXML, use a tMap and set the expression of the field as context.varName on tMap, this field will be assigned to XML element. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BBoePAAT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156017iC79D96C70B01B912/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BBoePAAT.png" alt="0693p00000BBoePAAT.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 13:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318195#M88561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-12T13:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318196#M88562</link>
      <description>&lt;P&gt;Thanks @Shicong Hong​&amp;nbsp;, if I am getting it correctly you're saying to add this context value in one of the output of tmap, then merge all 4 rows like the attachment, but then it would be a sub-element of one of the file, but I want it as one separate tag, say pdf like &lt;/P&gt;&lt;P&gt;&amp;lt;A&amp;gt;&amp;lt;/A&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;B&amp;gt;&amp;lt;/B&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;C&amp;gt;&amp;lt;/C&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;D&amp;gt;&amp;lt;/D&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/pdf&amp;gt;&amp;lt;/pdf&amp;gt;&lt;/P&gt;&lt;P&gt;Currently I don't have output file xsd, I am only doing a POC.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 15:23:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318196#M88562</guid>
      <dc:creator>mani1304</dc:creator>
      <dc:date>2021-01-12T15:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318197#M88563</link>
      <description>&lt;P&gt;@Shicong Hong​&amp;nbsp;Could you please suggest. I have taken that pdf into trowgenerator then tMap and assigning the value into it, Is it good or any better option for this.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 11:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318197#M88563</guid>
      <dc:creator>mani1304</dc:creator>
      <dc:date>2021-01-13T11:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: pdf file attachment into XML message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318198#M88564</link>
      <description>&lt;P&gt;My recommendation is writing a routine which accepts the file path and returns the base64 encoded String.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 15:42:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/pdf-file-attachment-into-XML-message/m-p/2318198#M88564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-13T15:42:35Z</dc:date>
    </item>
  </channel>
</rss>

