galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.14k stars 169 forks source link

Retrieving width and height of a FormXObject? #195

Closed peter-borgstedt closed 6 years ago

peter-borgstedt commented 7 years ago

How can I retrieve the width and height of an FormXObject? I've been vacuuming the whole internet for information on this, reading header files in the library and searching for some kind of clue.

I come up with NOTHING. The Hummus documentation of the API is lacking, where can I find a clear API documentation for methods/functions object/classes? So far I have had to retrieve information from stack overflow and the few tests cases in the repository and the documentation is just text with not details.

I've also read parts from the PDF reference.

galkahana commented 7 years ago

documentation can be found here - https://github.com/galkahana/HummusJS/wiki if you are looking for more than that. specifically what's available, go over the src root level. each object that hummus exports has a "driver" and this driver defines its properties and functions. for example, the driver for FormXobject can be found here. As can be seen there's no width and height members to it. so in essence - they're not available. its just that i never got to need them.

i either create the forms myself, and the i'll know what width i had for them - those come from here. alternatively the objects are created for images, in which case i'm using the methods for getting image measurements which set the form dimensions. (forms creating form images is here, and method to get image measurements is here.

peter-borgstedt commented 6 years ago

Yes, that's what I did eventually. Thanks.