Need help with Joomla? We are available for hire to help with Joomla customization, upgrades, maintenance, and custom development.
Explore our services

QRCODE size ignored and 'Unknown page format CUSTOM' error

  • John Campbell
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 weeks 4 hours ago #179857 by John Campbell
Hi,

I'm setting up a credit-card-sized (85.6 x 54mm) member card PDF and have run into two problems I can't get around from the template side.

Versions:
- Joomla: 5.4.8
- Membership Pro: 4.7.1

1) QRCODE Image Width/Height setting has no effect

In Member Card Settings I've set QRCODE Image Width and Height to 60 / 60, but the [QRCODE] image in the generated card always renders at about 39mm square on an A6 landscape page. This makes the card far taller than credit-card size and pushes the QR over the right-hand border.

What I've tried:
- Deleted the cached QR image in /media/com_osmembership/ so it regenerated. It came back at the same size.
- Added CSS targeting the image (td.qr img { width: 20mm; height: 20mm; }) both in PDF Settings > PDF CSS and in a <style> block in the card layout. No effect.
- Using my own <img> tag with width/height set works perfectly for sizing, but none of the available tags output the QR code's unique string (e.g. the value used for the QR filename like brpMDGmS....jpg), so I can't reproduce the correct code.

2) Page Format "Custom" throws an error

Setting Page Format to Custom in Member Card Settings causes:
"0 Unknown page format CUSTOM"
when a card is generated. I can't see any width/height fields to define the custom size. It looks like the word CUSTOM is being passed straight to TCPDF.

TCPDF has a built-in CREDIT_CARD format (85.6 x 53.98mm). Could that be added as a Page Format option, or could Custom be fixed to accept a width and height?

For now I'm using A6 Landscape with the card at 58% width, which works apart from the QR size.

Current settings for reference:
- Page Orientation: Landscape, Page Format: A6
- PDF Settings margins: Left 1, Right 1, Top 2, Bottom 2

Thanks

Please Log in or Create an account to join the conversation.

  • John Campbell
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 weeks 2 hours ago #179858 by John Campbell
Hi,

An update with more detail after further testing

Setup: Membership Pro with the Membership Pro - MPDF plugin (latest version). The PDF Producer field shows mPDF 8.3.2, so mPDF is generating the member cards.

1) QR code size: the QRCODE Image Width/Height setting isn't used

- With QRCODE Image Width and Height set to 60 / 60, I deleted a member's QR image from /media/com_osmembership/ and let it regenerate. The new file is still 185 x 185px, so the setting doesn't seem to be applied when the image is created.
- mPDF places that image at 96 dpi, so it prints at about 49mm square, far too big for a credit-card layout.
- As a test, I replaced one member's QR file with an 81 x 81px version containing the same code. The card then rendered perfectly, so the image size is the only problem.

Could the QR image be generated at the configured width/height, or could [QRCODE] output the img tag with width/height attributes so it can be sized?

2) CSS and config.php don't appear to be applied to member cards

- CSS added to plugins/osmembership/mpdf/css/member_card.css (including an img size rule and @page size) had no effect.
- A <style> block in the card layout also had no effect. Only inline styles work.
- A config.php in plugins/osmembership/mpdf/ containing 'img_dpi' => 235 and 'dpi' => 235 had no effect either. The QR stayed at 96 dpi.

Could you confirm whether member_card.css and config.php are loaded when generating member cards?

3) Page Format "Custom" error, and a workaround that leaves a blank page

- Setting Page Format to Custom still gives: "0 Unknown page format CUSTOM".
- As a workaround, I added this as the first line of the card layout:
<pagebreak orientation="L" sheet-size="54mm 85.6mm" margin-left="0" margin-right="0" margin-top="0" margin-bottom="0" margin-header="0" margin-footer="0" />
- This produces a correct 85.6 x 54mm landscape card on page 2, but page 1 is a blank A6 page, because the document is created at the Page Format size before the layout is rendered.

I need a single card-sized page to print directly to a card printer (CR80). Could the Custom page format be fixed to accept a width and height, or could a credit-card size (85.6 x 54mm) be added as a Page Format option?

Current settings: Page Orientation Landscape, Page Format A6, PDF margins Left 1 / Right 1 / Top 2 / Bottom 2.
Thanks

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #179860 by Tuan Pham Ngoc
Hi John

There are several issues here. I can confirm the last one (custom Page Format) is not supported in the mpdf plugin yet. Will correct it

For the two other issues, better we check it directly on your site. Could you please submit a support ticket sending us super user account of your site so that we can check to see what's wrong and get it sorted?

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #179861 by Tuan Pham Ngoc
For custom PDF size, could you please download and install updated package of MPDF plugin at joomdonation.com/downloads/plg_osmembership_mpdf_joomla5.zip , then try again to see if it fixes custom PDF format issue?

Tuan

Please Log in or Create an account to join the conversation.

  • John Campbell
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 5 days ago #179881 by John Campbell
Hi

Thank you for the update

We've decided to re-design without the QRCODE so that solves that issue. I'll download the new MPDF and try the page size again. As it stands having a 2 page PDF is workable so may just stick with that for now as we need to get our lists imported as soon as possible

Please Log in or Create an account to join the conversation.

More
2 weeks 4 days ago #179883 by Tuan Pham Ngoc
OK, thanks John for the update. Please continue using the extension, if you have questions or need assist, please don't hesitate to ask us

Regards,

Tuan

Please Log in or Create an account to join the conversation.