Skip to main content
Solved

HTML to pdf

  • October 5, 2017
  • 3 replies
  • 355 views

jeroen
Contributor
Forum|alt.badge.img+15

I would like to create a workflow that can convert an HTML page to a pdf file. The image below is an example of what the web page looks like with a map, this map is purely an html file with a layout created in html and request GET links loaded by the website. Can this somehow be read in' as is' via FME and converted to pdf?

I am currently using ColdFusion to render this page and save it as pdf .Unfortunately, this process is very intensive and I would like to put the last paret of this process to an FME server.

Best answer by redgeographics

In that case, yes, you can use an ImageFetcher to grab the images and a HTTPFetcher to grab the page itself and then produce the layout with the PDFPageFormatter. Speaking from experience, it can be a bit of a hassle to get it looking really nice, but the overall layout doesn't look too difficult.

Just for clarification: you technically wouldn't be converting the HTML page but rather you'd be rebuilding it.

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.

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3704 replies
  • October 5, 2017

So the map itself is also pure HTML? No image?


jeroen
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • 97 replies
  • October 5, 2017

The images are generated with get requests in code requesting PNG's in the DPI that i need and are not saved in the HTML itself except for the code that is requesting it. This keeps the size of the HTML to 30kb per sheet.

https://xxxxxs/xxxx/xxx/wms?LAYERS=L1m1&FORMAT;=image%2Fpng8&SLD;=xxxxxxxt%2Fsld%2Fol_sld_L1m1.xml&STYLES;=&TRANSPARENT;=TRUE&SERVICE;=WMS&VERSION;=1.1.1&REQUEST;=GetMap&FORMAT;_OPTIONS=%27dpi:180%27&CQL;_FILTER=stijlid%20IN%20(1%2C2%2C3%2C4%2C5%2C6%2C7)&SRS;=EPSG%3A28992&BBOX;=144684.42187575,479301.52251656,144925.93341201,479481.86241918&WIDTH;=2998&HEIGHT;=2339


redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3704 replies
  • Best Answer
  • October 5, 2017

In that case, yes, you can use an ImageFetcher to grab the images and a HTTPFetcher to grab the page itself and then produce the layout with the PDFPageFormatter. Speaking from experience, it can be a bit of a hassle to get it looking really nice, but the overall layout doesn't look too difficult.

Just for clarification: you technically wouldn't be converting the HTML page but rather you'd be rebuilding it.