Excellent, thank you, Daniel! The keyword was 'drawDOM'. In my project I wanted to build all QRCodes in background but, based on documentation, I realised they have to be visible and in a HTML container (DIV) to export them all. It works!
I now struggle with the page size and border. I have set it that way:
The weird thing now: Even though I have defined the paper size (A4) and the margins the exported PDF looks 1:1 as they are presented in the #dummydiv: 3 lines of QRCodes, cut off on the right side of the PDF file. See therefore the attachment:
- all_qrcodes.png : Shows all the QRCodes in the dummydiv inside the Browser
- cut_off_in_pdf.png : Shows the right side of the PDF-exported dummydiv (cut off at margin-right)
I would have guessed the kendo.drawing.exportPDF function would consider the page size and margins but it doesn't. To check this out I made the Browser window smaller so that there are 4 QRCodes on each line. Exporting this shows then also 4 QRCodes in the exported PDF file.
It would work if I set a hardcoded dummydiv length to the official A4 length (minus set margins) but then I'm loosing any dynamic (like changing the paperSize or landscape/portrait). So the question is: Should the kendo.drawing.exportPDF function care/consider set pageSize and margin or do I have to do this programmatically?
Furthermore I realised that no second PDF page will be created for the left QRCodes. They are just not showing/displayed in the exported PDF (kinda cut off at the bottom). I assume this is also related to the overall problem.