logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
stan  
#1 Posted : Friday, February 22, 2019 11:27:34 AM(UTC)
stan

Rank: Newbie

Groups: Registered
Joined: 2/21/2019(UTC)
Posts: 8

Hi,

I have a barcode image that I need to insert into a field / control on a pdf. I have a PdfBitmap object with the barcode.
Code:

 FS_RECTF FieldRect = barCodeField.Controls[0].BoundRect;
 PdfBitmap imageMap = PdfBitmap.FromFile(@"C:\image.png");
 PdfImageObject imageObject = PdfImageObject.Create(Document, imageMap, 0, 0);
 imageObject.Matrix = new FS_MATRIX(FieldRect.Width, 0, 0, FieldRect.Height, FieldRect.left, FieldRect.bottom);
 


The code above works okay with getting the image onto the pdf. The problem is the location is off a little. I need it to be exactly where the control / field is.

Thank You
stan  
#2 Posted : Friday, February 22, 2019 2:48:07 PM(UTC)
stan

Rank: Newbie

Groups: Registered
Joined: 2/21/2019(UTC)
Posts: 8

Additionally does Pdfium have a native way to handle barcode generation and insertion to Pdfs?
Paul Rayman  
#3 Posted : Friday, February 22, 2019 9:28:54 PM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 789

Thanks: 1 times
Was thanked: 98 time(s) in 96 post(s)
Could you please provide a PDF document and a screenshot which indicates where exactly the barcode should be placed
stan  
#4 Posted : Tuesday, February 26, 2019 12:38:34 PM(UTC)
stan

Rank: Newbie

Groups: Registered
Joined: 2/21/2019(UTC)
Posts: 8

Sorry for the long time between replies. I figured out the issue. I was flipping the coordinate system and the conversion from inches to pixels. Thanks for the help
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.