Skip to main content

Hello everyone

I have a directory of PDF files and would like to select some of them for merging.

Is there a way of merging a list of PDF files to a multi-page PDF file?

Thanks.

Hi @kullboys,

It looks like you can do this by setting up the pdf_page_number attribute or alternatively there is a custom transformer that has been created to write to a multipage PDF file: https://hub.safe.com/transformers/pdfmultipageset.


I have a process built in FME that creates a number of PDF's for example about 20- I have a requirement now that

1) These need to be merged into one PDF containing the multiple pages.

2) PDF should then automatically be sent to the printer to print once process has completed

 

Nothing seems to be working very successfully - I have tried the above suggestions on combining the PDF based on creating a page number for each PDF. It works in part as in I end up with a pdf with multiple pages but half the content is missing,for example I cant see the map that should be contained in the PDF. Also I don't have a lot of control over size/orientation. Is there no simple way to combine PDF output like the online tools you can use to merge multiple PDF?

 

Anyone know of a third party tool I could use with FME to combine the PDF?

 

Lastly has anyone tried to send PDF or multiple PDF's to a printer ??

 

 

Thanks

 

Ciara


I have a process built in FME that creates a number of PDF's for example about 20- I have a requirement now that

1) These need to be merged into one PDF containing the multiple pages.

2) PDF should then automatically be sent to the printer to print once process has completed

 

Nothing seems to be working very successfully - I have tried the above suggestions on combining the PDF based on creating a page number for each PDF. It works in part as in I end up with a pdf with multiple pages but half the content is missing,for example I cant see the map that should be contained in the PDF. Also I don't have a lot of control over size/orientation. Is there no simple way to combine PDF output like the online tools you can use to merge multiple PDF?

 

Anyone know of a third party tool I could use with FME to combine the PDF?

 

Lastly has anyone tried to send PDF or multiple PDF's to a printer ??

 

 

Thanks

 

Ciara

Hi @ciarab,

I'm concerned that if you are simply setting the pdf_page_number attribute this is causing a change to the content of your PDF files. Can you confirm this is the case, or is there a loss of data when the PDF is being read in? If you are able to provide a copy of a few of the PDFs in question I would be happy to take a further look into this.

The PDFPageFormatter should also give you more control over the page layout.

In terms of a third party tool unfortunately I am not aware of anything, other than perhaps the custom transformer designed by one of our users I previously linked to above. However it sounds like you have already tried this with no luck.

Lastly, in regard to sending files to a printer, you could use a SystemCaller transformer to perform this action as it allows you to run a program or operating system through the command line.


@hollyatsafe thanks for the response, I think the PDF is being read in okay. Most of the PDF's I want to merge contain the mapframe with the map details and then the marginalia around the map. So the map content itself is lost somewhere along the way when I try to generate the merged output. I have attached two PDF I am trying to merge into one as an example

 

I guess I thought it might be easier than it seems, I dont really want to have to recreate the PDF's I have already generated. But maybe the PDF formatter is the only way.

 

Maybe if merging together is too difficult I might be able to use system caller to send each PDF to the printer in an ordered manner. Maybe this is a simpler solution if I can get this working?

 

3914_1012-A-11_1300.pdf


@hollyatsafe thanks for the response, I think the PDF is being read in okay. Most of the PDF's I want to merge contain the mapframe with the map details and then the marginalia around the map. So the map content itself is lost somewhere along the way when I try to generate the merged output. I have attached two PDF I am trying to merge into one as an example

 

I guess I thought it might be easier than it seems, I dont really want to have to recreate the PDF's I have already generated. But maybe the PDF formatter is the only way.

 

Maybe if merging together is too difficult I might be able to use system caller to send each PDF to the printer in an ordered manner. Maybe this is a simpler solution if I can get this working?

 

3914_1012-A-11_1300.pdf

Hi @ciarab, I think you would be on an easier track, trying to use SystemCaller to send the PDF to the printer. When you read using the PDF Reader and then write it out, it might take a lot of tweaking of the Reader parameter settings and potentially PDFStyler setting to get all the original formatting correct.

Using a Directory and File Pathname Reader (PATH reader for short), you can retrieve all the 20 + DPF's file pathname and use a SystemCaller to pass those file names into a command line for printing. If you need to manage the order the PDF gets printed, you can use the attribute generated by the PATH reader to sort them in a sorter transformer.

 

with this method, you don't need to involve PDF reader. The process should be a lot faster too.

I have a process built in FME that creates a number of PDF's for example about 20- I have a requirement now that 

1) These need to be merged into one PDF containing the multiple pages.

2) PDF should then automatically be sent to the printer to print once process has completed

 

Nothing seems to be working very successfully - I have tried the above suggestions on combining the PDF based on creating a page number for each PDF. It works in part as in I end up with a pdf with multiple pages but half the content is missing,for example I cant see the map that should be contained in the PDF. Also I don't have a lot of control over size/orientation. Is there no simple way to combine PDF output like the online tools you can use to merge multiple PDF? 

 

Anyone know of a third party tool I could use with FME to combine the PDF?

 

Lastly has anyone tried to send PDF or multiple PDF's to a printer ??

 

 

Thanks

 

Ciara

Have you tried GhistScript?

A command line something like this might do the ordered PDF merge job: 

"c:\Program Files\gs\gs9.25\bin\gswin32c" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="c:\My Files\combined.pdf" "c:\My Files\first.pdf" "c:\My Files\second.pdf"

 


Hi @ciarab, I think you would be on an easier track, trying to use SystemCaller to send the PDF to the printer. When you read using the PDF Reader and then write it out, it might take a lot of tweaking of the Reader parameter settings and potentially PDFStyler setting to get all the original formatting correct.

Using a Directory and File Pathname Reader (PATH reader for short), you can retrieve all the 20 + DPF's file pathname and use a SystemCaller to pass those file names into a command line for printing. If you need to manage the order the PDF gets printed, you can use the attribute generated by the PATH reader to sort them in a sorter transformer.

 

with this method, you don't need to involve PDF reader. The process should be a lot faster too.
Thanks @xiaomengatsafe I went with the systemcaller option for the moment and I have left them as single pdf files. It meets our requirements, thanks for the help

Have you tried GhistScript?

A command line something like this might do the ordered PDF merge job: 

"c:\Program Files\gs\gs9.25\bin\gswin32c" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="c:\My Files\combined.pdf" "c:\My Files\first.pdf" "c:\My Files\second.pdf"

 

@revesz thanks for the response, I will certainly look into this to see if it will deal with the merge for me!! appreciate it


Reply