Page 1 of 1

C# resize pdf to append an barcode

Posted: Fri Jan 27, 2023 6:03 pm
by username77
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

Re: C# resize pdf to append an barcode

Posted: Tue Jan 31, 2023 3:42 pm
by Hugo
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