<?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>question Re: How to merge two pdf files  from two flow files into one pdf file in Nifi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/373191#M241521</link>
    <description>&lt;P&gt;Apache PDFBox is supposed to allow you to merge PDF content. Since this is a Java library you can create a scripted Groovy processor to merge the files for you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pdfbox.apache.org" target="_blank"&gt;https://pdfbox.apache.org&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://javadoc.io/doc/org.apache.pdfbox/pdfbox/2.0.27/index.html" target="_blank"&gt;https://javadoc.io/doc/org.apache.pdfbox/pdfbox/2.0.27/index.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Jun 2023 19:21:23 GMT</pubDate>
    <dc:creator>joseomjr</dc:creator>
    <dc:date>2023-06-25T19:21:23Z</dc:date>
    <item>
      <title>How to merge two pdf files  from two flow files into one pdf file in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/359596#M238158</link>
      <description>&lt;P&gt;HI ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Could you please help me&amp;nbsp;How to merge two pdf files&amp;nbsp; which are coming from two flow files into one pdf file in Nifi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to merge two files (invoice file and QR File) from two flowfiles and used mergecontent&amp;nbsp; &amp;nbsp;processor but only single file(first file from 2 input files but not merged file) coming as merged file, with the combined file size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Files flow:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PradNiFi1236_1-1671116150957.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36466i2A5131311108B6FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PradNiFi1236_1-1671116150957.png" alt="PradNiFi1236_1-1671116150957.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;for the first flow file updateattribute maintained fragment.index=0 and second flowfile udpateattribute maintained fragment.index=1 and for combined flowfile updateattribute Before merge processor&amp;nbsp; given fragment.count=2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mergecontent Config:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PradNiFi1236_0-1671115906902.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36465i227392494358A070/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PradNiFi1236_0-1671115906902.png" alt="PradNiFi1236_0-1671115906902.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 14:57:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/359596#M238158</guid>
      <dc:creator>PradNiFi1236</dc:creator>
      <dc:date>2022-12-15T14:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge two pdf files  from two flow files into one pdf file in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/359703#M238168</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the problem you have with the merge is that your property "Merge Strategy" needs to be set to "Defragment" after that it should work if both flowfiles also have the same fragment.identifier set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To merge those pdfs Im not 100% sure how it can be easily done, but one solution would be to set also the property "Merge Format" to tar/zip of your MergeContent processor and do it later via script unpack and merge together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 12:09:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/359703#M238168</guid>
      <dc:creator>Faerballert</dc:creator>
      <dc:date>2022-12-16T12:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge two pdf files  from two flow files into one pdf file in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/359728#M238176</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/99104"&gt;@PradNiFi1236&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;NiFi is designed to be data agnostic.&amp;nbsp; So content that NiFi ingested is preserved in binary format wrapped in a NIFi FlowFile.&amp;nbsp; It then becomes the responsibility of an individual processor that needs to operate against the content to understand the content type.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The mergeContent processor does not care about the content type.&amp;nbsp; This processor numerous merge strategies:&lt;BR /&gt;- Binary concatenation simply writes the binary data from one FlowFile to the end of the binary data from another.&amp;nbsp; There is no specific handling based on the content type.&amp;nbsp; So combining two PDF files in this manor is going to leave you with unreadable data which explains why even with the larger content type of the merged FlowFile, you still only see the first PDF in the merged binary.&lt;BR /&gt;- Tar and zip combines multiple pieces of content in to a single tar file.&amp;nbsp; You can then later untar or unzip this to extract the multiple separate pieces of content it contains.&amp;nbsp; So would preserve both independent PDF files.&lt;BR /&gt;- FlowFile stream is&amp;nbsp; unique to NiFi and merges multiple NiFi FLowFiles (A FlowFile consist of content and FlowFile metadata.&amp;nbsp; This strategy is only used to preserve that NiFi metadata with the content for future access by another NiFi.&lt;BR /&gt;- Avro expects the content being merged is already of Avro format.&amp;nbsp; This will properly merge Avro type data in to single new Avro content.&lt;BR /&gt;&lt;BR /&gt;So the question here is first, how would you accomplish the merging of two PDF outside of NiFi.&amp;nbsp; Then investigate how to accomplish the same within NiFi, if possible.&amp;nbsp;&lt;BR /&gt;TAR and ZIP will work to get you one output file; however, if your use case is to produce 1 new PDF form 2 original PDFs, mergeContent is not going to do that.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic"&gt;If you found that the provided solution(s) assisted you with your query, please take a moment to login and click&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Accept as Solution&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;below each response that helped.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;Matt&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 19:07:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/359728#M238176</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-12-16T19:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge two pdf files  from two flow files into one pdf file in Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/373191#M241521</link>
      <description>&lt;P&gt;Apache PDFBox is supposed to allow you to merge PDF content. Since this is a Java library you can create a scripted Groovy processor to merge the files for you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pdfbox.apache.org" target="_blank"&gt;https://pdfbox.apache.org&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://javadoc.io/doc/org.apache.pdfbox/pdfbox/2.0.27/index.html" target="_blank"&gt;https://javadoc.io/doc/org.apache.pdfbox/pdfbox/2.0.27/index.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2023 19:21:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-merge-two-pdf-files-from-two-flow-files-into-one-pdf/m-p/373191#M241521</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2023-06-25T19:21:23Z</dc:date>
    </item>
  </channel>
</rss>

