C# resize pdf to append an barcode

Discussions about PDF management.
Post Reply
username77
Posts: 5
Joined: Fri Jan 27, 2023 5:53 pm

C# resize pdf to append an barcode

Post by username77 » Fri Jan 27, 2023 6:03 pm

Hi is possible to resize the first page of an pdf or enlarge the page with an white background to append an barcode.

In that case we avoid that the barcode overlaps the image.


I use c# .net4.8

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: C# resize pdf to append an barcode

Post by Hugo » Tue Jan 31, 2023 3:42 pm

Hi there,

We have a solution to this which you can find here:
https://www.gdpicture.com/guides/gdpict ... geBox.html

Basically all you need to do is set this as follows:
SetPageBox(PdfPageBox.PdfPageBoxMediaBox, float Left, float Top+"White Area value" float Right, float Bottom)
This would allow you to set a white area above your PDF where you would be able to then use such a method to draw barcodes:
https://www.gdpicture.com/guides/gdpict ... ode1D.html

This also allows you to preserve all the contents in your PDF as this does not require rasterization.

Regards,
Hugo Cudd
Technical Support

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest