PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Shawn@EVENT on May 01, 2020, 09:48:06 AM

Title: printing a jpg file on a pdf document is getting unexpected results
Post by: Shawn@EVENT on May 01, 2020, 09:48:06 AM
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?
Title: Re: printing a jpg file on a pdf document is getting unexpected results
Post by: Devon Austen on May 01, 2020, 10:14:16 AM
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?
Title: Re: printing a jpg file on a pdf document is getting unexpected results
Post by: Shawn@EVENT on May 01, 2020, 10:19:01 AM
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
Title: Re: printing a jpg file on a pdf document is getting unexpected results
Post by: Mike King on May 01, 2020, 10:29:45 AM
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)
Title: Re: printing a jpg file on a pdf document is getting unexpected results
Post by: Shawn@EVENT on May 01, 2020, 10:30:40 AM
I'm using mode 5
Title: Re: printing a jpg file on a pdf document is getting unexpected results
Post by: Shawn@EVENT on May 11, 2020, 11:39:04 PM
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