0

I regularly receive shipping address labels in pdf format from the post. The pdf document containing the address label is formatted in a very stupid way taking up the entire A4, while just A6 would be enough. One has to cut about 70% of the page and throw the excess paper to trash, to get the address label. Then one has to use a glue stick to glue it on the shipment.

The label contains the recipient's address details, sender's details, and postage & tracking information, both as a barcode.

I would rather use standard self-adhesive sticker labels and a label printer instead. To achieve this, I would need to process each pdf file to crop out the label, shrink parts (the boxed fields) of the label slightly to fit it to the A6 shipping label size.

The cropped label needs to be downscaled to A6 size. But how to prevent the barcode from getting broken? Pdfposter breaks the parcel tracking barcode.

Shipping label A4 pdf

Ossi Viljakainen
  • 489
  • 2
  • 5
  • 15
  • 1
    You need to crop, ok. But do you need to resize/scale too? If so, this could add some issue in barcode reading. Hop you just have to crop. See http://pdfcrop.sourceforge.net/, http://www.linuxcertif.com/man/1/pdfcrop/#EXAMPLES_2241h - For resizing/scalling, see https://github.com/tavinus/pdfScale/blob/master/pdfScale.sh – cmak.fr Mar 12 '19 at 10:19
  • Cropping is not enough, needs also scaling, and possibly even more complicated operations, such as scaling down only the boxed fields, while maintaining the bardcode size. Thanks for the links, I will study them and see how to solve this. – Ossi Viljakainen Mar 12 '19 at 10:38
  • Thanks, so far I have been able to crop & downscale with the following: pdfcrop --margins '-86 -1 -86 -250' infile.pdf outfile.pdf But how to prevent the barcode from getting broken? Pdfposter breaks the parcel tracking barcode. However, the postage stamp barcode doesn't get broken. How to fix this? – Ossi Viljakainen Mar 13 '19 at 05:37
  • Is pdfposter treating the pdf (including the barcode) as a raster image, rather than as vector? – Ossi Viljakainen Mar 13 '19 at 06:12
  • what is pdfposter ? – cmak.fr Mar 13 '19 at 07:38
  • https://pythonhosted.org/pdftools.pdfposter/ – Ossi Viljakainen Mar 13 '19 at 12:45

0 Answers0