#1 2011-08-23 17:45:43

redbird
Member
Registered: 2011-06-29
Posts: 2

Position of an Element/Object

Hi there,

first of all thank you for creating the Synopse PDF Engine and all the other stuff.

I'm currently using SynPDF and the HTML2PDF unit to convert HTML files to Pdf files. Lately I've added barcodes as bmp images to the HTML files, however their scaling in the resulting pdf file makes them pretty useless because they can't be read correctly.

As an alternative, I thought it might be possible to draw the barcodes "manually" by using an canvas object. That works, but for positioning that barcode I need to have some kind of anchor, because the content (and with it the layout) of the html file might change. So, is there a way to determine the position of an (    identifiable) element in a TPDFDocument when using the html2pdf unit?

Offline

#2 2011-08-24 16:45:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: Position of an Element/Object

"Communication" between the html renderer and the pdf engine is made via a TMetaFile.

I think an efficient way of doing it is to add GDI comments records to the TMetaFile.

See how "bookmarks" and "outlines" are added, using a GDI comment record.
You can use a similar technique to indicate a barcode to write.

Offline

#3 2011-08-26 18:00:32

redbird
Member
Registered: 2011-06-29
Posts: 2

Re: Position of an Element/Object

Ok, I'll take closer look at this. Thank you.

Offline

Board footer

Powered by FluxBB