4d-component-wkhtmltopdf

This message is firstly aimed for 1 person (I wish he will recognize himself :pray: )

I love this https://github.com/miyako/4d-component-wkhtmltopdfnew wkhtmltopdf> as a component instead as a plugin.

Everything works well when the I use the demo.

I placed the code in a component: a pdf is generated but it contains the path of the html file.
The folder wkhtmltopdf is in both resource folder : host and component.

What should I look at to troubleshot this issue?

Thanks

it should work the same way when used as a component, as long as you pass the same parameters.

case in point:

https://github.com/miyako/4d-component-wkhtmltopdf/releases/tag/1.0.h

it sounds like you passed a file path instead of an html source text?

: Keisuke MIYAKO

it sounds like you passed a file path instead of an html source text?
Exactly, works much better with html content :sunglasses:

: Keisuke MIYAKO

case in point:

Everything’s okay.

Small issue with images: why doesn’t the final PDF display my image but its alternate text?

I enclose your original demo with my html content.

http://forums.4d.com/4DBB_Main/x_User/3906/files/27039299.7z

Thank you

: Bertrand SOUBEYRAND
: Keisuke MIYAKO

case in point:

Small issue with images: why doesn’t the final PDF display my image
but its alternate text?

Nota bene: both on Windows 10 and High Sierra

your img src is a local relative path

Code :
LOGO1

you could specify a full path

e.g.

Code :
LOGO1

or use a base tag

Code :

with

Code :
LOGO1

of course, you might want to use PROCESS 4D TAGS to inject that path

Convert path system to POSIX(Get 4D folder(Current resources folder);*)

the currrent directory does not apply to file:// src.

https://stackoverflow.com/questions/4550612/wkhtmltopdf-cannot-convert-local-file

in other words

SET ENVIRONMENT VARIABLE("_4D_OPTION_CURRENT_DIRECTORY";"…")

will not solve your issue.

: Keisuke MIYAKO

Does the path to a file have length limit?? in my case it has 199 chars

that’s a webkit question, but I think you should be fine. max path length is normally 1023 on windows, if not 260. and 1023 on Mac.

: Keisuke MIYAKO

that’s a webkit question, but I think you should be fine. max path
length is normally 1023 on windows, if not 260. and 1023 on Mac.
Exactly. I tested a bit further and it works fine.

Thanks fellow guy