Question

Create PDF from an Excel file


Hello everyone,

after creating a few excel files in my workbench I wanted to sum them up in a pdf file. I used the FeatureWriter to create the Excel files. After each FeatureWriter I inserted a PDFPageFormatter which I connected to a normal Writer for the PDF. What happens is nothing. The Excel files and the PDF file has been created but the pages in the pdf are empty. I'd be thankful for hints.

Best regards,

Felix


8 replies

Userlevel 5
Badge +25

Are you handling geometry or not? If not, try the TableAdder custom transformer (available through the FME Hub) to create a table that can be inserted into the PDF.

Is there any other solution to use FME Hub? Unfortunately, I do not have any access to the internet on the computer I create the worbench with.

Userlevel 5
Badge +25

Well, that makes things a little bit harder for sure. How about you download it on another computer and then move it across on a usb drive?

Alternatively... the PDF writer wants to have geometry. If you create point features for all your records with the same x values but y values decreasing you can then use a LabelPointReplacer to add text to them and that should do the trick in a very very basic way.

Badge +2

Hi,

Try here to download

https://hub.safe.com/transformers/tableadder

Badge +8

Hi @felixderglueckl

1. Attached is the custom transformer; you just need to download it from here, right click then choose install from the menu.

 

2. I personally would prefer to write into MS Word then convert the file manually to pdf. Much more flexible than writing into pdf directly I presume.

Cheers.

Lyes

 

 

tableadder.fmx

 

Badge

Hi @felixderglueckl

1. Attached is the custom transformer; you just need to download it from here, right click then choose install from the menu.

 

2. I personally would prefer to write into MS Word then convert the file manually to pdf. Much more flexible than writing into pdf directly I presume.

Cheers.

Lyes

 

 

tableadder.fmx

 

I think Lyes idea about outputting the file to a word document and then converting it to PDF will probably save you a lot of hassle. You could alsowrite it to and excel file and convert that to a pdf manually. If you want the conversion process to be automated you can look into something like PDFCreator which can be run from a commandline. It will create a flat file PDF from any printable type format.

 

Hello everybody and thank you so much for your answers. I tried to use the TableAdder as you told me and it works. I have just one problem. The height of the table which should be saved in the pdf file is variable that means it could be possible that the table needs more than just one page in the pdf document. Is it possible to display one table on more pages?

Userlevel 5
Badge +25

Hello everybody and thank you so much for your answers. I tried to use the TableAdder as you told me and it works. I have just one problem. The height of the table which should be saved in the pdf file is variable that means it could be possible that the table needs more than just one page in the pdf document. Is it possible to display one table on more pages?

I think you will need to determine how many rows you can display on one page and split the data accordingly to divide it over multiple pages. The PDFPageFormatter does take a fixed value for the page number, but there's also a pdf_page_number attribute (off the top of my head, I'm not sure whether I got the exact spelling) you can fill with the right page number.

 

 

Reply