Unable to resize the label

19 views
Skip to first unread message

Be the Change

unread,
Feb 22, 2024, 2:07:51 PMFeb 22
to qz-print
Hi, 

I'm testing printing a label of size 2.62 X 1 inch using Zebra ZD421 printer and using the "Print PDF" button from the sample.html page. Even though I supply a label of size 2.62 X 1 inch inside assets folder and name it as "pdf_sample", it keeps behaving like the following:

1.  If I use Adobe PDF print as printer name, the content is generated as a PDF of 8.5 X 11 inches size of paper. 

2, If I user my printer name ZD 421, the contests are too small to read. 



To test it from sample.html, I've modified the following existing QZ Config:
/// QZ Config ///
   var cfg = null;
    function getUpdatedConfig(cleanConditions) {
        if (cfg == null) {
            cfg = qz.configs.create(null);
        }

        updateConfig(cleanConditions || {});
        return cfg
    }
 To the following:

/// QZ Config ///
    var cfg = null;
    function getUpdatedConfig(cleanConditions) {
        if (cfg == null) {
          cfg = qz.configs.create(
        "Adobe PDF",
        //" ZDesigner ZD421-203dpi ZPL",
        { scaleContent: "true" },
        { orientation: "landscape" },
       // { orientation: "portrait" },
        {
          size: { width: 2.62, height: 1 },
          units: "in",
          colorType: "grayscale",
          interpolation: "nearest-neighbor",
        }
      );
        }
  updateConfig(cleanConditions || {});
        return cfg
    }


Above case is where I am trying to print it as PDF and that's why I've PDF printer selected. However, it doesn't seem to be generating the PDF of size of label I specified in the size section of the config above. What I might be missing?

Thanks

Lite Finocchiaro

unread,
Feb 22, 2024, 2:53:40 PMFeb 22
to Be the Change, qz-print
For a virtual printer like Adobe, you may have to add a custom page size to the operating system to achieve the desired results.

Is this Windows, MacOS, or Linux?

The ZD421 is usually 200 or 300 dpi, which will not yield high-definition results compared to a laser or inkjet printer. If you want to send me the PDF you're printing, I can test on my GK420d (200 dpi) and share the results with you. You can share this off-list if you want.

I look forward to your reply.

Kind regards,

Lite Finocchiaro
VP, QZ Industries


--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qz-print/bd16aa47-e36f-4973-a325-1f65d256710an%40googlegroups.com.

Lite Finocchiaro

unread,
Feb 24, 2024, 5:38:34 PMFeb 24
to Be the Change, qz-print

Whether you're using base64 to supply the data or a URL/file location, the source data (printData) PDF should be sized similarly to your label size for the best results. 
This should give you the best apples-to-apples print results in my experience. 
PDFs have actual dimensions in inches or centimeters as part of their properties, unlike other raster graphics, such as images or HTML, which use pixels.

If you're using an 8.5x11 PDF and scaling it down to 2.62x1, you're going to get a result that is scaled down so far it will be barely legible, which is what I'm seeing in the pictures.

Since it looks like you have coded a config, please be aware that some of these manipulations will be further manipulated by any config options you perform using the sample.html from the browser, while others will be ignored.

If you want to send along your logs, I'm happy to look at them, but I believe this issue can be easily solved by using the right size source data and scaling.

Cheers,

Lite





On Sat, Feb 24, 2024 at 2:13 AM Be the Change <beth...@gmail.com> wrote:
The way I was testing is as follows:

I am using base64 PDF approach (like mentioned here : https://qz.io/docs/pixel#pdf-printing) to print a PDF using the size parameters that I mentioned in the thread and it always came out as 8.5 X 11 inch PDF. And then I used this PDF in the assets folder to try to print it again directly to my ZD421 printer and since I was using the same size configuration, I was expecting that QZ tray woud handle the supplied configuration to handle the 8.5 X 11 inch PDF and print it on a 2.62 X 1 inch label. But it sounds like I should directly print and bypass the PDF generation and testing approach.

On Fri, Feb 23, 2024 at 6:23 AM Lite Finocchiaro <lite.m.fi...@gmail.com> wrote:
To be clear, are you using the 8.5x11" PDF to print to the label printer via sample.html? I would expect the results you're seeing in the top three labels if that's the case.

If you use the 2.62x1 PDF via QZ-Tray to print to the label printer, using autoScale: true and with the printer set to the correct size labels, I would expect the results to be similar to the last print, which I'm guessing was achieved with Adobe or a similar PDF viewer. Correct me if I'm wrong.

Cheers,

Lite


On Thu, Feb 22, 2024 at 4:36 PM Be the Change <beth...@gmail.com> wrote:
Hi Lite,

I am on Windows 11. When you say " For a virtual printer like Adobe, you may have to add a custom page size to the operating system to achieve the desired results." did you mean to say that while printing via QZ Tray, I need to provide some different configuration in sample.html?

I am attaching the two PDFs that is getting generated from my application. 

1. PDF #1 (label_size_pdf_feb22.pdf): This is 2.62 X 1 inch label size that I am able to generate from my application without using QZ Tray and when I am printing it directly to my ZD 421 printer, it prints fine as shown in the image attached in this email.

2. PDF#2: (pdf_sample.pdf) : This is the PDF that QZ Tray is printing (as 8.5 X 11 inches size) using configuration settings I showed earlier in my post.I specified size as :

{
          size: { width: 2.62, height: 1 },
          units: "in",
          colorType: "grayscale",
          interpolation: "nearest-neighbor",
        }

But it didn't seem to make any difference while printing it to my ZD421 printer and image seems to be printing very tiny as shown in the image attached in this email. If I just print to Adobe PDF, it will print the text nicely in a 8.5 X 11 inches PDF. However, printing it to ZD 421 seems to be printing like I have shown in the image attached ( the first 3 labels were the result of printing via QZ Tray and the as label was the result of directly printing the label to ZD 421 printer w/o having QZ Tray involved.)


Please let me know if you need any more info.

Thanks
AK

Lite Finocchiaro

unread,
Mar 18, 2024, 11:22:16 AMMar 18
to Be the Change, qz-print

Please keep the list on copy for new support questions or start a new email thread; someone else may be able to answer your question, and I was very busy when this email came through, hence the late reply.

Can you share your config? (I can get this from the logs as well) 

I'm also not sure what format Jasper Report uses for the print data, but turning off dithering in the driver settings may improve the barcode quality. The overlapping content makes me wonder if there's an issue with the source data.

Some printers are better for small barcodes, but they tend to have a higher DPI (and therefore better quality).

Kind regards,

Lite
VP, QZ Industries

On Wed, Mar 13, 2024 at 11:45 AM Be the Change <beth...@gmail.com> wrote:
Hi Lite,

I have another question where I'm trying to print a code 128 barcode (with Jasper Report) on my label and the quality of the label seems to be not good. Please find the image attached. Is there a way it can be improved while using QZ Tray?

Thanks!

Tres Finocchiaro

unread,
Mar 18, 2024, 11:24:01 AMMar 18
to Lite Finocchiaro, Be the Change, qz-print
@Lite Finocchiaro please provide a sample from Jasper without any live/production/customer data.

Tres Finocchiaro

unread,
Mar 18, 2024, 11:24:18 AMMar 18
to Lite Finocchiaro, Be the Change, qz-print
Whoops, I meant beth...@gmail.com. :)

Be the Change

unread,
Mar 18, 2024, 2:30:06 PMMar 18
to qz-print
You mean a sample without involving QZ Tray and a PDF directy generated from Jasper with barcode?

Lite Finocchiaro

unread,
Mar 18, 2024, 4:05:00 PMMar 18
to Be the Change, qz-print
If it's a PDF, yes. We can't tell from your email what's being sent to the printer.

You can send them off-list if there's sensitive information, but the logs will show us what the data source is.

--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.

Be the Change

unread,
Mar 19, 2024, 3:03:56 PMMar 19
to Lite Finocchiaro, qz-print
Here's the PDF I generated without using QZ tray, which is coming straight out of Jasper. The overlapping with the sentence that you noticed in my earlier PDF was because of the smaller text "BIS#" ( hence the barcode wasn't stretched out). The one I generated has "TESTINGTEST#1" so the barcode is stretched out and is very clear. I will try to share the config you requested as soon as I get a chance.


LABEL_with_barcode_without_qztray_with_test_TESTINGTEST.pdf

Lite Finocchiaro

unread,
Mar 19, 2024, 5:23:32 PMMar 19
to Be the Change, qz-print
I'm afraid this test PDF's barcode does not print clearly on my 203dpi Zebra GK420d, and fails to scan with a phone app whether it's printed on Adobe or QZ-Tray. Photo attached.

The barcode measures less than one inch, but contains 49 black bars of varying sizes across that distance.

At that scale, you literally have to be dot and pixel perfect, which is difficult to translate from a PDF to this printer.

I would recommend either a higher DPI printer or a larger barcode.

Regards,

Lite

IMG_20240319_170454172.jpg
Reply all
Reply to author
Forward
0 new messages