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

Notification

Icon
Error

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

Rank: Member

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

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)
Quote
stan

Rank: Member

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

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)
Quote
Paul Rayman

Rank: Administration

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

Thanks: 3 times
Was thanked: 109 time(s) in 106 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)
Quote
stan

Rank: Member

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

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
Quick Reply Show Quick Reply
Users browsing this topic
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.