BinaryKits.Zpl icon indicating copy to clipboard operation
BinaryKits.Zpl copied to clipboard

Viewer convert to PDF instead image

Open ingfdoaguirre opened this issue 2 years ago • 5 comments

Hi I recently made some PRs to fix some bugs.

This was the initial viewer result, before fixes: first

And after fixes this was the result: label0

This is the result using Labelary: labelary

I can say that is approximately the same result, maybe your viewer needs some tune(in font sizes and types) , but nothing big.

Now that those bugs are fixed, I need want to know if can I create a PDF file instead a image files, I know that I can create a PDF and add 1 image per page, but I saw in Labelary that, when you donwload as PDF file, the resulting file doesnt have images on each PDF page, it have text.

This is an example that proves that if you download PDF from Labelary, all is rendered as text (I select it, to prove it): 2022-06-05_22-27

So can I create a PDF instead an image? or do I need to investigate and create my own function?

Thank you!

ingfdoaguirre avatar Jun 06 '22 05:06 ingfdoaguirre

Hi, I have an update.

I'm using pdfSharp to create PDFs based on ElementDrawers from viewer, with some modifications.

At this moment I had ported this classes to draw in a PDF page, instead a image (I created other classes adding Pdf before Element, like TextFieldPdfElementDrawer):

TextFieldElementDrawer
QrCodeElementDrawer
FieldBlockElementDrawer
Barcode128ElementDrawer
Barcode39ElementDrawer
BarcodeEAN13ElementDrawer

The text highlighted in pink, is text, not an image!

2022-06-10_17-25

This library can be a real competition for labelary for zpl to pdf conversion

=====UPDATE 10/06/22=====

Image from Labelary labelary1

My Pdf drawer (is not an entire image, is text + images (barcodes, qrcodes, graphics) labelary2

Font is Arial, because Zpl fonts are from Zebra, and Arial is a default one in Windows, linux etc.

Here is the PDF test file with the same ZPL code 16 times (Created with ZPL code repeated 16 times) test.pdf

The major benefit to draw directly in a PDF instead an Image is the filesize, a PDF with images and 50 labels, was like 10mb, with this method, the filesize is reduced to only 436kb, with the same 50 labels.

Also processing time was cut from 30+ seconds to only ~8 seconds to process the same labels.

ingfdoaguirre avatar Jun 11 '22 00:06 ingfdoaguirre

Hi @ingfdoaguirre,

Will you plan to share these codes with us?

oytunyuksel avatar Jun 29 '22 08:06 oytunyuksel

@ingfdoaguirre Thank you!

Hi I recently made some PRs to fix some bugs.

Just to confirm the PDF support is to allow user download a PDF file, and has nothing to do with the web page rending?

YipingRuan avatar Aug 15 '22 04:08 YipingRuan

Hello @ingfdoaguirre

Is there any example I can use to create PDF files instead of images? Thank you

gurunathgopireddy avatar Aug 18 '22 12:08 gurunathgopireddy

Hello @ingfdoaguirre ,
pdf conversion is something I am currently missing here. Could you please share the code with us? I think this will help many people out there which need to handle label requirements :)

Thanks a lot and best regards

avan2s avatar May 22 '23 21:05 avan2s