We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Barcode GetRegion()

Hello,

I am trying to determine the bounding rectangle of the barcode (Version 3.1.1). When I scan the following PDF I get the following points (at least on page 1):

(0): {X = 25 Y = 16}
(1): {X = 31 Y = 2025}
(2): {X = 210 Y = 2025}
(3): {X = 211 Y = 16}

Could you please tell me the units?

Thanks,

Don Tompkins

Hi Don,

The unit is pixel.

Hello,

Thank you for your response. Then what units do PDF.Kit.PdfFileInfo.GetPageWidth and GetPageHeight return?

When I call PDFPageWidth and PDFPageHeight I get the following results of my PDF page:

PageHeight: 792
PageWidth: 612

When when I scan a barcode on the page I get this result:

(0): {X = 25 Y = 16}
(1): {X = 31 Y = 2025}
(2): {X = 210 Y = 2025}
(3): {X = 211 Y = 16}

Are the resolutions different? I need some time of correlation between the two units that are returned.

Thank you,

Don Tompkins

Hi Don,

We will get back to you on this shortly.

Hi Don,

The image on page 1 of the attached pdf document is actually large in size. I opened the pdf file in Adobe Reader 9, copied image and pasted in MS Paint. The actual image height and width was larger than it looks in the pdf as embedded image.

It seems that while embedding this image in pdf, it was scaled to some ratio e.g. 0.33f (33% of original size). Will it be possible for you get the scale ratio when you are inserting the image in pdf file?

When extracted images from pdf are saved to image, they retain their original height and width. And Aspose.BarCode component uses that extracted image to read barcode and get the region information.

GetPageWidth

I have the same question as Don: " What units do PDF.Kit.PdfFileInfo.GetPageWidth and GetPageHeight return?". I only know that they return float dataType. But in what unit? inch? pixel?, ect.

Hi Michelle,

You must be aware that Aspose.Pdf.Kit will be merged in Aspose.Pdf product. So the place to post your inquiry is the Aspose.Pdf forum.

Thank you for your understanding and cooperation.

You probably find its in Java’s default units where 72 units is 1 printed inch.