WPCubed Product Support

Issues with QR Codes

wpsupport

Thanks for the files. In the EMF the barcode is not present, therefor wPDF does not have the data to export it.
I assume the drawing code is not optimized to print on a metafile canvas.

Maybe it uses GetDeviceCaps(LOGPIXELSX) to get and work with the device resolution. This does not work well, it is better to set the resolution directly and work with this resoltion.

Such drawing code has to be encapsulated by SaveDC/RestoreDC.

procedure SetupVirtualCanvas(Canvas: TCanvas; TargetWidth, TargetHeight: Integer); const
  VirtualWidth = 800;
  VirtualHeight = 600;
begin
  SetMapMode(Canvas.Handle, MM_ANISOTROPIC); // Ermöglicht freie Skalierung
  SetWindowExtEx(Canvas.Handle, VirtualWidth, VirtualHeight, nil);
  SetViewportExtEx(Canvas.Handle, TargetWidth, TargetHeight, nil); 
 end;

If the drawing code uses a special font, it would be better to buffer the output on a monochrome bitmap.

#4 ♥ 0
1.2k Views 1 links 2 users read 2 min

Thank you very much!

I’ve sent all the files you requested to the support team. I tried the setting you suggested, but unfortunately the export quality got much worse.

#3 ♥ 0
wpsupport

You can send an EMF file to support so we can check.

To create a EMF file set property

wPDF.DebugMode tot true. It will create a file in the same directory of the EXE.

If bitmaps are missing durcing export this can be caused by Windows. Try to set the property CanvasReference to Printer.

#2 ♥ 0

Dear WPCubed,

We are currently using your component for exporting files to PDF within our application. Recently, we have encountered an issue related to QR codes: they do not appear to be generated or rendered correctly in the exported PDF files.

To help illustrate the problem, we have attached an example source file along with the corresponding exported PDF generated using your component. Here is the link.

Could you please assist us in troubleshooting this problem? If you need additional details (such as code samples, configuration settings, or example PDF outputs), we would be glad to provide them.

Thank you in advance for your support. We look forward to your guidance on how to resolve this issue.

Best regards,

Luca

#1 ♥ 0