<?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: XML to PDF conversion not working for 40+ records in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255847#M38425</link>
    <description>&lt;P&gt;Hi &lt;SPAN&gt;rhall_2_0&lt;/SPAN&gt;,&lt;/P&gt; 
&lt;P&gt;Please find below the routine.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;public class pdf{&lt;/P&gt; 
&lt;P&gt;public static void pdfMethod(String dependentFilePath, String fileOutputXML, String fileOutputPDF) {&lt;/P&gt; 
&lt;P&gt;OutputStream out=null;&lt;/P&gt; 
&lt;P&gt;try{&lt;/P&gt; 
&lt;P&gt;String filePathFlow=dependentFilePath;&lt;/P&gt; 
&lt;P&gt;StreamSource xmlSource=new StreamSource(new File(fileOutputXML));&lt;/P&gt; 
&lt;P&gt;FopFactory fopFactory = FopFactory.newInstance(new File(filePathFlow+File.separator+"fop.xconf"));&lt;/P&gt; 
&lt;P&gt;FOUserAgent foUserAgent = fopFactory.newFOUserAgent();&lt;/P&gt; 
&lt;P&gt;out= new java.io.FileOutputStream(&lt;SPAN&gt;fileOutputPDF&lt;/SPAN&gt;);&lt;/P&gt; 
&lt;P&gt;out= new java.io.BufferedOuputStream(out);&lt;/P&gt; 
&lt;P&gt;Fop fop= fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);&lt;/P&gt; 
&lt;P&gt;TransformerFactory factory =&amp;nbsp;&lt;SPAN&gt;TransformerFactory &lt;/SPAN&gt;.newInstance();&lt;/P&gt; 
&lt;P&gt;String styleSheetFilePath= &lt;SPAN&gt;dependentFilePath&lt;/SPAN&gt;+&lt;SPAN&gt;File.separator+&lt;/SPAN&gt;"pdf.xsl";&lt;/P&gt; 
&lt;P&gt;Transformer t&lt;SPAN&gt;ransformer = factory.newTransformer(new StreamSource (new File(styleSheetFilePath)));&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Result res = new SAXResult(fop.getDefaultHandler());&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;t&lt;SPAN&gt;ransformer.transform(xmlSource,res);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}catch (Exception e)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;{ e.printStackTrace();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;finally{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;IOUtils.closeQuietly(out);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Mar 2020 06:14:37 GMT</pubDate>
    <dc:creator>guptashiv</dc:creator>
    <dc:date>2020-03-20T06:14:37Z</dc:date>
    <item>
      <title>XML to PDF conversion not working for 40+ records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255845#M38423</link>
      <description>&lt;P&gt;I am trying to fetch records from DB and creating an XML file.&lt;/P&gt; 
&lt;P&gt;Now, to convert this XML into a PDF file, I have created a routine which uses a style sheet (.xsl) and XML file and uses apache FOP framework and makes a&amp;nbsp; transformer call to create pdf.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Its working fine upto 40 records, but is taking a long time for more records.&lt;/P&gt; 
&lt;P&gt;Can anyone suggest how to resolve this issue.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;Shivangi gupta&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 08:59:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255845#M38423</guid>
      <dc:creator>guptashiv</dc:creator>
      <dc:date>2020-03-19T08:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: XML to PDF conversion not working for 40+ records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255846#M38424</link>
      <description>&lt;P&gt;It's very difficult to help without more details about your routine. The only thing I can think of is that it is a memory issue. Is your method for doing this a static method? If not, it might be an idea to convert it to a static method.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 11:23:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255846#M38424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-19T11:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: XML to PDF conversion not working for 40+ records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255847#M38425</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;rhall_2_0&lt;/SPAN&gt;,&lt;/P&gt; 
&lt;P&gt;Please find below the routine.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;public class pdf{&lt;/P&gt; 
&lt;P&gt;public static void pdfMethod(String dependentFilePath, String fileOutputXML, String fileOutputPDF) {&lt;/P&gt; 
&lt;P&gt;OutputStream out=null;&lt;/P&gt; 
&lt;P&gt;try{&lt;/P&gt; 
&lt;P&gt;String filePathFlow=dependentFilePath;&lt;/P&gt; 
&lt;P&gt;StreamSource xmlSource=new StreamSource(new File(fileOutputXML));&lt;/P&gt; 
&lt;P&gt;FopFactory fopFactory = FopFactory.newInstance(new File(filePathFlow+File.separator+"fop.xconf"));&lt;/P&gt; 
&lt;P&gt;FOUserAgent foUserAgent = fopFactory.newFOUserAgent();&lt;/P&gt; 
&lt;P&gt;out= new java.io.FileOutputStream(&lt;SPAN&gt;fileOutputPDF&lt;/SPAN&gt;);&lt;/P&gt; 
&lt;P&gt;out= new java.io.BufferedOuputStream(out);&lt;/P&gt; 
&lt;P&gt;Fop fop= fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);&lt;/P&gt; 
&lt;P&gt;TransformerFactory factory =&amp;nbsp;&lt;SPAN&gt;TransformerFactory &lt;/SPAN&gt;.newInstance();&lt;/P&gt; 
&lt;P&gt;String styleSheetFilePath= &lt;SPAN&gt;dependentFilePath&lt;/SPAN&gt;+&lt;SPAN&gt;File.separator+&lt;/SPAN&gt;"pdf.xsl";&lt;/P&gt; 
&lt;P&gt;Transformer t&lt;SPAN&gt;ransformer = factory.newTransformer(new StreamSource (new File(styleSheetFilePath)));&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Result res = new SAXResult(fop.getDefaultHandler());&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;t&lt;SPAN&gt;ransformer.transform(xmlSource,res);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}catch (Exception e)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;{ e.printStackTrace();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;finally{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;IOUtils.closeQuietly(out);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 06:14:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255847#M38425</guid>
      <dc:creator>guptashiv</dc:creator>
      <dc:date>2020-03-20T06:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: XML to PDF conversion not working for 40+ records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255848#M38426</link>
      <description>&lt;P&gt;There is clearly a lot going on during the conversion. You will need to add some logging I think to identify where the code slows down. I suspect that this is a memory issue. Have you tried adding more memory to the job?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 10:38:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-to-PDF-conversion-not-working-for-40-records/m-p/2255848#M38426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-20T10:38:53Z</dc:date>
    </item>
  </channel>
</rss>

