Solved

Convert HTML page to image file

  • 3 October 2016
  • 7 replies
  • 42 views

Badge +1

Hi,

is it possible to convert HTML page to jpg file.

Thank you, cheers.

icon

Best answer by dmitribagh 3 October 2016, 20:51

View original

7 replies

Userlevel 5

I'm not sure FME is the best tool for that. However there are a lot of utilities out there specifically for this, you will find many of them if you google e.g. "convert html to image".

If necessary, you could probably automate such a tool using FME.

Badge +16

Hi @zzupljanin, I agree with @david_r on the issue, you could try to automate it via FME and PhantomJS

Good luck and have fun!

Badge +7

Hi @zzupljanin,

I suggest you take a look at the next website where you can download a command line tool to make the conversion. Using a SystemCaller you can call this tool via FME.

 

https://www.coolutils.com/HTML-JPG-CommandLine

 

Good Luck!

 

Userlevel 2
Badge +11

@zzupljanin

 

I made a custom transformer that turns HTMl into a raster using WKHTML2Image command line tool, I can publish later this week (and update this thread with the link).

 

I published a similar transformer that turns html into a PDF last week:

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

Userlevel 2
Badge +11

Hi @zzupljanin

 

Here is the transformer to convert HTML to images. Note that we only create a wrapper to call the tool within FME and have no control over the image creation.

 

 

https://hub.safe.com/transformers/html2imageconvertor
Badge

Hi,

i tried phantomjs to get an image of an url. Well, it works perfektly when running the workbench via the "run"-button. but the SystemCaller fails to execute, when the Workbench is run from within a batchfile as a scheduled task.

Here is my setup for the SystemCaller...

Any hints????

Userlevel 4
Badge +26

Hi,

i tried phantomjs to get an image of an url. Well, it works perfektly when running the workbench via the "run"-button. but the SystemCaller fails to execute, when the Workbench is run from within a batchfile as a scheduled task.

Here is my setup for the SystemCaller...

Any hints????

As a quick guess, it's a permissions problem. You have permission for your action when you are logged in and using FME, but your scheduled task is not running as the same user with the same permissions, therefore it fails.

 

I'll also note that it sounds like you are reading an image from a URL. You can do that directly with the HTTPCaller and there would be no issue of using the SystemCaller.

 

Anyway, just to mention that you might get a better response if you post this as a new question, rather than a comment on another one.

 

Hope this helps

 

Mark

 

Reply