Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

QR code in Postscript File

New Here ,
Jan 30, 2019 Jan 30, 2019

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

TOPICS
Programming
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 30, 2019 Jan 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2019 Jan 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 31, 2019 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 31, 2019 Jan 31, 2019
LATEST

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 cleardictstack100 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines