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

Free Support Forum - aspose.com

Location of barcode

Hi,

We are having difficulty finding the combination of the numbers in the mendor.addImage call that will insert a vertical barcode to the upper left margin of the pdf file attached (w9taxform.pdf and w8bentaxform.pdf). The java source code (with .txt extention) and the resulting pdf (w9taxform-verticalOffPosition.pdf) using the following call are also attached.

mendor.addImage(inImgStream, pages, 0, 570, 70, 780);

The barcode shouldn't overlay any text, it should be top aligned with text "W-9" or "W-8". Please advise what numbers to use in addImage to achieve that, is there a way to know where default "0,0" position is, what kind of tool we need to use to find the postion combination. In addition, is there a way to change the font size of barcode caption meaning make "123456789" in a smaller size?

Thanks.

Hi,

To make the caption smaller, you can call the BarCodeBuilder.SetCodeTextFont() method as follows:

b.setCodeTextFont(new Font(“Times New Roman”, 0, 12));

The3rd parameter is font size, you can make it more smaller if you want.

You can also hide the codetext by passing false to BarCodeBuilder.setCodeTextVisible() method.

Regarding the placement of barcode image on top left corner and coordinates explanation, a support member from Aspose.Pdf.Kit team will comment here shortly.

Hi Joanna,

I had already shared the sample (workaround) code for the related issue in the Aspose.Pdf.Kit forums. I have also logged this issue is our issue tracking system. You can follow up this issue and find the details at the following post:
<a href="https://forum.aspose.com/t/119172

I hope this helps. If you have any other questions, please do let us know.
Regards,