Solved

Hi, I'm wondering if it possible to 'data stream' a PDF document? Attached is my workbench. The workflow is: Call a reporting engine via a HTTPcaller which returns the PDF I'd then like to publish this to a datastream service. Is this possible?

  • 15 October 2021
  • 7 replies
  • 21 views

Badge +4

I have used the 'filecopy' writer. The workbench works fine within FME desktop but when I run as a 'data stream' within FME server I get a message saying 'There was an Error'. See attached screenshot. I guess the question is, is it possible to 'data stream' a PDF. And if it is, should I be using a PDF writer?

icon

Best answer by bearman 21 October 2021, 05:47

View original

7 replies

Userlevel 4

If FME is generating the PDF, you should probably use the PDF writer for the streaming service.

If the PDF already exists, try using the Data File writer: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/datafile/datafile_writer.htm

These settings should be a starting point:

data file writer

Badge +2

As david_r mentioned, you just have to include the PDF writer in the streaming service when publishing to FME Server. If you would like to see an example of this, check out this workspace app on our demos page.

 

Regarding the Data Streaming Service... this supports formats like HTML, PNG, KML, GeoRSS, GeoJSON, PDF, and others.

Badge +4

Thankyou for your help. I haven't been able to have any success with writing the PDF using the 'Data File' writer. But it sounds like the PDF writer is probably the way to go anyway. So if I have an existing pdf I should theoretically be able to use a PDF reader to read from the existing PDF and use a PDF writer to write to a copy of the PDF. (Then I can publish this as a data stream service). Problem is, I cannot for the life of me get this workflow to work where the written pdf is a 'copy' of the existing pdf. This seems like a simple process but perhaps the PDF writer is more designed to write objects to a PDF rather than copy whole PDF's?? Can anybody setup a workbench that achieves the process I've described?

Userlevel 4
Badge +25

Thankyou for your help. I haven't been able to have any success with writing the PDF using the 'Data File' writer. But it sounds like the PDF writer is probably the way to go anyway. So if I have an existing pdf I should theoretically be able to use a PDF reader to read from the existing PDF and use a PDF writer to write to a copy of the PDF. (Then I can publish this as a data stream service). Problem is, I cannot for the life of me get this workflow to work where the written pdf is a 'copy' of the existing pdf. This seems like a simple process but perhaps the PDF writer is more designed to write objects to a PDF rather than copy whole PDF's?? Can anybody setup a workbench that achieves the process I've described?

The PDF reader/writer is indeed not really suited to making 1-on-1 copies of PDF's (due to there being a lot of things possible in PDF) and even if it would it would process the entire original PDF while it sounds you simply want to publish it to a Data Streaming service.

What exactly did you try with the Data File writer?

Badge +4

Thanks for the assistance. I was able to get a solution to this by including the AttributeFileReader transformer. See attached workbench.

Badge +3

Thanks for the assistance. I was able to get a solution to this by including the AttributeFileReader transformer. See attached workbench.

Hey @bearman , do you still have this workbench? I am running into the same situation, and hoping to use your example to solve the issue

Badge +4

Hi @vhruska, see the attached which has the relevant combination of transformers. The AttributeFileReader with the below parameters achieved the desired result.

 

 

Reply