Hi there,
I am using the 1.1.18 version of
Html2PdfConverter for generating pdf from webpage. However, after several try, I couldn't able to generate the header.
I am using the following Otherargs
"--encoding utf8 --page-size A4 -L 10 -R 10 --header-html "+Site.EnvironmentUrl+"Header.aspx --footer-html "+Site.EnvironmentUrl+"Footer.aspx"
Any help would be appreciated!
Thanks in advance
Amrita
You must set the BinariesDirectory site property path based on the installation. In the OutSystems cloud it should be D:\User
--
Swatantra
Hi Amrita,
the argumment you are passing in OtherArgs may incorrect.
please check service center log once.
Check this site- https://wkhtmltopdf.org/usage/wkhtmltopdf.txt
to define proper format header and footer
Regards
Rahul Sahu
Hi Rahul,
Thanks for your reply. I was able to generate header with a html file(header html) with the above mentioned command. However, when I was trying to generate the same with an aspx it just simply showing nothing.
Thanks
As of i know aspx is not able to generate header and footer .
you need to create html page with .html extention and you can bind with header and footer in same way.
Rahul Sahu wrote:
--header-html option works with the .aspx page as well. At the end it generates the html which is being rendered by the component.
Make sure the aspx page which you want to consume as header is lightweight. If it is computing and logic then I would advise to add the delay option
--javascript-delay <msec>
The html in your experience is similar to the aspx ?
The normal aspx pages generated by the platform has a heavy CSS. In traditional web a UI Flow with "Email" theme can be used to build the header and footer pages to avoid the addition of not used CSS.
Graça
Maria da Graça Peixoto wrote:
Indeed, the page generated by the platform is CSS overloaded. To use as pdf header/footer, a light theme should be used.
Hi Grace,
Thanks for you suggestion. I tried with the below mentioned layout. Still no luck. It just generates blank space at the top.
Amrita Basu wrote:
Amrita,
Did you check if the header web screen has Anonymous role enabled?
You may also checkout PDF Header and Footer component, which is fairly easy to use, but the options are limited compared to Html2PdfConverter.
Hi Swatantra,
Thanks for your reply. I checked the component "PDF Header and Footer" which comes with old version of Html2PdfConverter(16.x).
However, I found a solution with a little bit trick ofcourse. I used html file to generate header and footer html with querystring parameters which I wanted as dynamic value. Then by using javascript I fetched the value to the appropriate div element. That solves my purpose.
Thanks and Regards
That's indeed a nice workaround.
This also makes it clear that the header was dynamic with some operation being performed on the aspx page as indicated above.
Thanks for the solution. You made my day! Yes it's actually that settings worked at the end.