PrizmDoc Hybrid Viewing: Reduce server viewing requirements and streamline document processing
Enable your employees to remain productive
throughout the document management process.
Learn how SmartZone uses a regular
expression engine integrated into the recognition engine to achieve the best possible accuracy
on data that can be defined by a regular expression.
The tale of how an underdog is going head-to-head with a tech giant (and winning).
How can I get a document’s dimensions with PrizmDoc?
There are two methods you can use to do this with PrizmDoc:
The first method is using the requestPageAttributes() method from ViewerControl. This method allows you to get the width and height of a page in the document in pixels. Below is sample code on how to use requestPageAttributes() to get the attributes of page 1 of a document:
var pageWidth = attributes.width;
var pageHeight = attributes.height;
The second method is done by making a GET request to the PrizmDoc server to get metadata for a page of the source document in a viewing session. The request is:
The content type needs to be set to “png” for raster content and “svgb” for SVG content. The request returns the data in a JSON object containing the image’s width and height. The units for the width and height are in pixels when the contentType is set to “png” and unspecified units when the content type is set to “svgb”.
The request also returns the horizontal and vertical resolution of raster content when the content type is set to “png”. This information is similar to pixels per inch, but the units are unspecified, so if you wanted to calculate the size of the document you can calculate it by width divided by horizontal resolution or height divided by vertical resolution. The resolution is hard-coded to 90 when contentType is set to “svgb”.