Skip to main content
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?

  • October 15, 2021
  • 7 replies
  • 95 views

bearman
Participant
Forum|alt.badge.img+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?

Best answer by bearman

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

david_r
Celebrity
  • October 15, 2021

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


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • October 18, 2021

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.


bearman
Participant
Forum|alt.badge.img+4
  • Author
  • Participant
  • October 18, 2021

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?


redgeographics
Celebrity
Forum|alt.badge.img+62

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?


bearman
Participant
Forum|alt.badge.img+4
  • Author
  • Participant
  • Best Answer
  • October 21, 2021

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


vhruska
Contributor
Forum|alt.badge.img+6
  • Contributor
  • March 1, 2024

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


bearman
Participant
Forum|alt.badge.img+4
  • Author
  • Participant
  • March 4, 2024

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