PxPlus User Forum

Twitter Twitter Twitter

Author Topic: printing a jpg file on a pdf document is getting unexpected results  (Read 308 times)

Shawn@EVENT

  • Member
  • **
  • Posts: 10
    • View Profile
Hi.
I'm trying to print a QR code on a pdf and I'm getting an unexpected result.  The image is displaying on the pdf as three small QR codes instead of one larger one

I created the QR code in linux using the command 'qrencode' which generates a .png file.

I then convert the file to jpg using the imagemagick convert command 'convert file.png file.jpg'

I am printing the jpg image on the pdf using:
PRINT (pdf_file) 'PICTURE'(x,y,x,y,"file.jpg",5),

If I convert the .png file to .jpg using windows paint and print the jpg file using the code above, the QR code prints correctly.

Attached are images of what I'm experiencing.

Has anyone experienced this before and have any suggestions?
« Last Edit: May 01, 2020, 09:54:01 AM by Shawn@EVENT »

Devon Austen

  • Staff
  • Diamond Member
  • *****
  • Posts: 247
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Printing a PNG to a PDF is supported in Linux PxPlus as of PxPlus 2019. If using PxPlus 2019 you can skip the conversion.

If you open the converted .jpg before printing it to the PDF does it look correct?
Software Developer for PVX Plus Technologies LTD.

Shawn@EVENT

  • Member
  • **
  • Posts: 10
    • View Profile
Thanks for the quick response Devon

Yes I knew the the most recent version allows .png files without conversion.  The client is using v15.10 though.

Yes the .jpg file looks ok when I open it in paint

attached is the actual jpg file if that helps
« Last Edit: May 01, 2020, 10:23:30 AM by Shawn@EVENT »

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3353
  • Mike King
    • View Profile
    • PVX Plus Technologies
What mode are you specifying on the 'PICTURE' mnemonic? 

It likely should be 5 or 6 (top left aligned or centered, scaled maintaining aspect ratio)

Shawn@EVENT

  • Member
  • **
  • Posts: 10
    • View Profile
I'm using mode 5

Shawn@EVENT

  • Member
  • **
  • Posts: 10
    • View Profile
FYI I figured out a resolution to this issue.

When I convert the file to jpg using the imagemagick convert command, I used 'convert -quality 100 -type TrueColor file.png file.jpg'

The resulting jpeg file printed correctly when using the 'PICTURE'(x,y,x,y,"file.jpg",5), command