Skip to main content
Participant
January 30, 2019
Question

QR code in Postscript File

  • January 30, 2019
  • 2 replies
  • 2052 views

Hi all

I am a newbie to Postscript.  I inherited an application which generates a Postscript file.  The client now wants to add a QR code to the file to provide information.

I reviewed Terry Burtons blog and found a potential method to generate a QR code.

I then tried to append it to my existing PS file.


page 1 of the PS file prints but the second page - nothing prints - everything just stops.


Any thoughts or ideas appreciated.

Anyone successfully added a qr code?

Thanks


Eddie

This topic has been closed for replies.

2 replies

Participant
January 31, 2019

All,

I found the issue.    It was reccomented to review FAQs · bwipp/postscriptbarcode Wiki · GitHub

I had used Terry Burton's code for the QR code.  This worked.  The original PS worked but when I merged the two I had issues.

How do I include BWIPP in a messy PostScript document?

Many automatically generated PostScript documents include boilerplate resources (procedure sets, etc.) that pollute the VM environment such then when the BWIPP resources are defined or invoked the meaning of standard operators has been redefined leading to erratic or broken behaviour.

You can often protect against this by wrapping a standard invocation as follows.

countdictstack array dictstack dup length 3 sub 3 exch getinterval cleardictstack
100 300 moveto (1234567) () /qrcode /uk.co.terryburton.bwipp findresource exec
{begin} forall

I still had a few issues regarding spurious characters generated when creating the PS file but I resolved those.

Many thanks for the help

Eddie

Legend
January 30, 2019

You appended it? So it would be on a new page? Did you include a "showpage" for the new page, blank except for the barcode?

Participant
January 30, 2019

Hi

Thanks for the reply.   There is a showpage.  However only page 1 is displayed.

The original 2 page document printed.  Page 2 has data and originally a barcode.  I removed the barcode postscript code and appended the Postscript code to build the QR code and then the code to print the qrcode data.

I know that there were RENDERER definitions /renlinear and /renmatrix resources in the original barcode postscript so I changed the new ones to /renlineara and /renmatrixa in case there was an issue there but still no page.

Is there a postscript debugger available?

Kind regards

Eddie

Legend
January 31, 2019

Simple test: does the QR code PostScript work, by itself, with just a showpage added at the end?

Have you got a printer error handler for PostScript? If not try GhostScript.