Forge Component
(60)
Published on 17 May by Guilherme Pereira
60 votes
Published on 17 May by Guilherme Pereira

Hi guys just a quick question if anyone has experienced this with HtmlToPDFconverter on download we added pdfHeader(MarketDetail_Header) and pdfFooter (MarketDetail_Footer) with PDF URL (MarketDetail_PDF). All of them generate properly in one PDF though in Lifetime Analytics the hits are going to the footer instead is there a ruling here of how things get counted? Would be nice if it counts the screen of the PDF URL(MarketDetail_PDF).


Hi Clintjie ,


Actually I would expect to have all 3 pages counted instead of just the footer.


How are you including the header and the footer?


Cheers,

Guilherme

Hi Guilherme, we followed the example here https://www.outsystems.com/forge/component-overview/1242/pdf-header-and-footer and just assigned it like this in the picture the generation works it's just lifetime analytics that shows a different hits. There are times we have 50k hits for the footer while MarketDetail_PDF has about 10.

Not sure if it is important but we do have Akamai set up there and on download of the PDF the URL is pointing to the default OutSys prod env while browsing on the Akamai URL.

Hi Clintjie,


By looking at the example I'd say that you should expect 3 requests for every pdf generation (one for each part). Caching could definetly explain why you get more hits on a part rather than the other but typically CDN cache static contents and I'm unsure if the pdf should be cached.

In any case if one of the parts is being  cached you should check if your end users are not getting pdfs with the context mixed up as parts could come from cache.

One thing you could do is to place a few audits in your pages to explicitly log the requests and see if you can detect why this is happening.


Cheers,

Guilherme

Hi Guilherme thanks for the quick response, currently we are trying to simulate the hit counts in DEV environment. Both PROD and DEV has the same hit count behavior so it's not an issue with Akamai.

When removing both the assigned Header and Footer as mentioned on the last post, the hit counts don't add up anymore for the Footer and PageHeader. Before they were disabled the Footer and PageHeader count usually adds 2-3hits per download.

We also tried to audit the page hit count using assign preparation the main body PDF gets called once so it gets 1hit count per download but both Header and Footer gets hit counts randomly between 2-5 per download.

Also we do cache some pages but not the ones used in Header, Footer and the main body. I'm curious as to how Html2PdfConverter calls the Header, Footer and main URL screens to be counted in the Hits of the Lifetime Analytics.

Hi Clintjie,


Html2pdf is a wrapper to wkhtmltopdf and doesn't call anything directly. Wkhtmltopdf instances a webkit based headless browser and calls the URLS but I don't know exactly how it handles header/footer scenarios.

In order to understand how it works in that scenario I believe you could try and post the question on their forums or take a peak at their source code both of which can be found on their gitbhub page.


Cheers,

Guilherme