Technical Differences in Printing Labels - LibreOffice vs PDF

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

Background:

I send a lot of parcels out via various courier services. For this I use Zebra label printers, which use the industry standard ZPL printer language, which comes with CUPS.
The Zebra printers are excellent workhorses and as a result pretty expensive. I recently purchased a chinese knock off that accepts the ZPL protocol, so is ok as a poor mans's substitute, to a point.

If I have a .zpl file, which is what Amazon supplies to print a label, I can use this code on either brand printer:

Code: Select all

lpr -P LABEL -o raw file.zpl

Where LABEL is the name of the printer on my system, and file.zpl is the label file downloaded from Amazon. This is flawless on the good printers and the cheap knock of printer.

However, who uses zpl right? Nobody except amazon. PDF is the go for just about everything else. If I use any freight company's site to make labels, it generates a PDF file for labels. For the Zebra printers, I just click print from the browser and it prints fine. If I do the same with the chinese printer, nothing happens. In CUPS is just comes up with pending since, sometimes it loads to around 30%, but it never actually prints.

Ok, I figure that I'm not using the official driver, just the zebra driver which this printer is compatible with, it can't handle printing from Linux for anything that isn't just a raw print queue. Except, then I remember two things. The printer prints the test page perfectly from CUPS, with the little image of tux and all. Also, I've used it in the past to make stickers of fairies and unicorns etc for the kids, it prints from LibreOffice.

Hey, it prints from LO. Ok, drag the downloaded PDF file into LO and click print. Whoosh, away goes the printer. Printer prints PDF files. Except, from LO it prints them sideways. Instead of being 4 x 6" labels, it's trying to print them as 6 x 4" labels, ie in landscape rather than portrait.
Nothing can be changed to make them print the correct way around. It's super frustrating.

Now onto the technical questions....

If I delve into LO's settings, it has options of how to communicate with the printer. It defaults to "Printer Language Type: PDF". This doesn't make sense to me. If I send the PDF file directly to the printer, it won't print. If I click print from a PDF viewer (browser or evince) it won't print. If I print, using PDF from LO it does print (albeit in the wrong orientation). So my only thought is that LibreOffice's PDF printing is different to everyone else's PDF printing. Printing from LO using any of the PostScript levels does not work.

So I guess the question is why does LibreOffice print a PDF to this printer and nothing else does? What does it do differently?

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by rcrsn51 »

When you load the PDF into LO, what is its orientation - landscape or portrait?

Is this problem in LO specific to the Chinese printer or does it also happen with the genuine model?

I figure that I'm not using the official driver, just the zebra driver which this printer is compatible with

Please explain.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by p310don »

Hi @rcrsn51

When you load the PDF into LO, what is its orientation - landscape or portrait?

It is in portrait, which is the correct orientation. When I click print preview, it changes when I click either landscape or portrait to it's respective position, but output to the printer is always sideways.
Since writing this, I have discovered I can get it to print to page size, but sideways. To clarify, the page is 4 x 6", I can get it to print sideways, scaled to 4 inches high and (I assume) 3 inches wide.

The driver I am using is the Zebra ZPL driver. That is obviously for Zebra printers. This printer is identified in CUPS as 4BARCODE 4B-2054L. I haven't had success in finding a working linux driver specifically for it.

This is the same as the printer in question:

https://vrettitech.com/products/420b-n? ... 2256985268

There is a deb driver here:

https://vrettitech.com/pages/420b-usb-support

I haven't gotten it to work using this driver in Fatdog. I have only spent about 2 minutes trying however.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by rcrsn51 »

p310don wrote: Fri May 10, 2024 3:02 am

The driver I am using is the Zebra ZPL driver. That is obviously for Zebra printers. This printer is identified in CUPS as 4BARCODE 4B-2054L. I haven't had success in finding a working linux driver specifically for it.

Are you talking about the filter built into CUPS? The one that CUPS would automatically provide when you choose the Zebra make/model in the CUPS setup?

Just to be clear: If you try to print a PDF label from the command line with lpr, you CANNOT use "-o raw". The document must go through the CUPS system to translate the PDF into ZPL using the zebra CUPS filter that you selected when you set up the printer

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by rcrsn51 »

Is this problem in LO specific to the Chinese printer or does it also happen with the genuine model?

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by p310don »

Are you talking about the filter built into CUPS? The one that CUPS would automatically provide when you choose the Zebra make/model in the CUPS setup?

It's not automatic, but yes, the one built into CUPS as seen in the screenshot attached.

I did try sending the raw PDF which locked the printer up. I also tried sending it without the raw option in the hopes that it has a PDF filter / interpreter (I don't know the correct term) built in. Neither worked. This is basically the crux of my question. Why does the PDF going directly through CUPS, either directly

Code: Select all

lpr -P LABEL test.pdf

or any other way not work, but LO does, but sideways. The sideways bit isn't really what worries me TBH.

I have had a look at the Genuine Zebra. Printing a PDF via LO works perfectly, as does printing a PDF any other way.

Attachments
xscreenshot-20240510T144835.png
xscreenshot-20240510T144835.png (59.5 KiB) Viewed 2323 times
LateAdopter
Posts: 124
Joined: Sat Aug 15, 2020 5:10 pm
Been thanked: 19 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by LateAdopter »

The short answer: Linux printing via CUPS has always been incapable of printing PDFs to a raster printer properly. If you want to print PDFs properly to a raster printer you have to use Windows.

I use Windows 2000 running in VirtualBox on Fossapup64 with Adobe Reader 7.0 from 2004, and it prints perfectly to my Epson Stylus Color 1520

Michael Sweet spent more than 20 years developing CUPS, mostly at Apple. When he announced that Apple were dropping printer drivers, there was a long debate in the mailing list about the consequences. The conclusion was that printing Amazon labels would be impossible. So Michael Sweet left Apple and developed a label printing system for linux. You might need to look at that.

For other purposes you have to buy a printer that supports driverless printing so that CUPS doesn't need pdftoraster. If Tim Cook tells Apple users to buy a new printer they will just do that.

Microsoft have an excellent guide on how GDI32.DLL and UNIPRINT.SYS print to raster printers.

Linux and MAC used to use PostScript and now they use PDF as their printing language. The problem is that the PDF implementation in ghostscript is incomplete. Also there is no reverse channel so the application cannot anti-alias its output for the specific printer setup.

I have tested printing PDFs from FossaPup64 and Fatdog directly.

For my test sample:
the ghostscript viewer would display the border but none of the content
qpdfview would display the border and content but only printed the border
evince would display and print the border and content apart from narrow grey lines.

The reason is that ghostscript, gstoraster and pdftoraster do not have all of the PDF functionality.
The twenty year old Adobe Reader 7.0 prints the same file perfectly, so there is nothing new in the file.

I infer that:
the ghostscript fails to decode the PDF in the file.
qpdfview uses its own PDF decoder for display but qprint sends the original PDF through CUPS which fails at pdftoraster.
evince uses its own PDF decoder for display and re-encodes it to be compatible with CUPS and pdftoraster, but it can't antialias the narrow grey lines.

On the subject of LibreOffice, my Epson Stylus Color 1520 can print A4 portrait mode or rotated A4. I can set up the print so that the preview is correct with rotated A4 but LibreOffice changes it back to portrait when I print. Some programs accept rotated A4 some don't.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by rcrsn51 »

When you load a PDF label into LO, does it open in Write or Draw?

I wonder if the chinese-vs-genuine issue has something to do with the amount of on-board memory in the units. A ZPL file is a set of instructions for how to create and print the label. CUPS sends the file directly to the printer whose engine then executes those instructions. A ZPL file is small so the unit doesn't need a lot of memory.

But to print anything else, like a PDF, CUPS may just convert it into a bitmap image and embed it in a ZPL file along with the instructions for printing it. This takes much more memory, so the chinese unit chokes on it.

It may be that LO massages the PDF into a smaller data stream that the chinese unit can handle, but the orientation gets changed in the process.

I also tried sending it without the raw option in the hopes that it has a PDF filter / interpreter (I don't know the correct term) built in.

When you set up the printer, CUPS selected the filter "rastertolabel". This is defined in the PPD file that CUPS generated when you selected the make/model.

One of the options in the CUPS setup is the label size. Do you have this set correctly for your model?

Have you tried printing on a Linux platform other that Fatdog?

Here is an analogy: In audio, a MIDI file contains the instructions for how to play a tune. It is like the digital version of a printed score. A WAV file is a recording of the score played on specific instruments. Your ZPL file is like the MIDI and a PDF is like the WAV.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by p310don »

When you load a PDF label into LO, does it open in Write or Draw?

Draw

I wonder if the chinese-vs-genuine issue has something to do with the amount of on-board memory in the units. A ZPL file is a set of instructions for how to create and print the label. CUPS sends the file directly to the printer whose engine then executes those instructions. A ZPL file is small so the unit doesn't need a lot of memory.

The file I was trying to print was 11 pages. I thought this might have been the issue too, so tried printing just one page, Still didn't work.

Have you tried printing on a Linux platform other that Fatdog?

Well bloody hell Bill. Up until just now, no I had not. In Fatdog, printing from PDF to this printer does not work, except from LO, but still incorrectly. I booted bookwork64 into a virtual machine, pointed the usb to the printer, installed it as a Zebra ZPL printer and downloaded a label. Printed correctly first go. Lucky fluke? So I downloaded the same 11 page label job from the other day, printed flawlessly.

Grrrr, F$#K.

So it seems that the issue possibly / probably lies within Fatdog's printing system. It is CUPS 2.4.6 vs BookWorm64's CUPS 2.4.2. I doubt that 0.0.2 difference makes the difference, but who knows..? There is still the legitimate question of what's different between LO printing and any other printing in Fatdog. Might be something for me to harass @jamesbond over (I know he *loves* my printing issues!)

Side story. The other night I had had an overly long day at work and just wanted to go home and see my kids. Knowing I had this printer at home, I packed 11 boxes into the back of my car and went home, knowing I could create the labels and finish the work later that night. I got the ZPL labels printed no problems, then ran into the PDF dramas. I spent 2 or 3 hours going down the stupid rabbit hole of printer settings, various PDF viewers, printer drivers from dodgy websites etc. I eventually printed all 11 labels by converting the PDF file to ZPL files using a free online converter. Unfortunately the free online converter will only convert one page at a time, but it tediously got the job done. If only I had tried loading Bookworm and done it from there. The whole bookworm process this morning took less than 5 minutes.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Methods - LibreOffice vs PDF

Post by rcrsn51 »

That's good news. How did you perform the successful print jobs? From the command line? From a browser? From LO?

IIRC, the Fatdog developers made a decision to replace Ghostscript with a different tool that does the rasterization - turns the PDF into a bitmap. Maybe that's the source of the problem.

Regarding LO: Because the PDF has been run through Draw instead of just being displayed in a Write document or a browser window, maybe it changes somehow and becomes more compatible with Fatdog's CUPS.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

I printed from both Firefox and the default PDF viewer. I didn't try command line.

I just tried installing ghostscript in FD, didn't make any difference to printing success for PDFs.

I just tried LO writer with just a few words. It has the same result as a PDF through Draw. Prints, but sideways.

@LateAdopter your information is interesting. I have seen the warnings when installing printers in CUPS about dropping raw support and driver support. There is a part of me that is looking forward to a driverless standard for printers. But, I have a fleet of label printers, along with 4 or 5 laser printers that are used daily in my business, and a little at home. They all generally work fine with PDFs and other sources (excluding the printer referenced in this thread). It seems crazy to drop support for legacy hardware, which leads me down the path of not liking updates for updates sake. That's a whole different discussion.
You're right, let the Apple fanboys just go out and buy a new printer because Tim Cook said so. In the meantime, I'll use my printers that work on generic toner and generic labels and not buy into the (conspiracy theory) capitalistic end game.

The conclusion was that printing Amazon labels would be impossible.

I find this an interesting assertion. In my searches this week, I came across a lot of forum / reddit threads of people trying to create a working solution for their label printer in linux. Sending the raw zpl file works in every circumstance I've come across. I'm probably missing something, but the language is in the printer. CUPS doesn't need a driver (it works if the printer is installed as RAW). If I knew how to send the file to the USB port the printer is attached to, I assume it'd still work. Happy to test that if you know how to :)

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by rcrsn51 »

p310don wrote: Sat May 11, 2024 1:28 am

I just tried installing ghostscript in FD, didn't make any difference to printing success for PDFs.

Some other changes to the CUPS config would be necessary.

I just tried LO writer with just a few words. It has the same result as a PDF through Draw. Prints, but sideways.

Is that in Fatdog or Puppy?

I have seen these warnings about how CUPS will eventually go to 100% driverless printing. But that means dropping support for ALL old non-AirPrint-compatible printers. And since AirPrint is designed for networked printers, it also cripples USB printing. I have tried the AirPrint-over-USB emulation and it sucks.

It strikes me that the CUPS developers have a vision of the future that will be at odds with the rest of the Linux world.

jamesbond
Posts: 718
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 124 times
Been thanked: 402 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by jamesbond »

rcrsn51 wrote: Sat May 11, 2024 1:45 am
p310don wrote: Sat May 11, 2024 1:28 am

I just tried installing ghostscript in FD, didn't make any difference to printing success for PDFs.

Some other changes to the CUPS config would be necessary.

This should do it: Edit /usr/share/cups/mime/cupsfilters-poppler.convs and change

Code: Select all

application/vnd.cups-pdf	application/vnd.cups-raster	98	pdftoraster

to

Code: Select all

application/vnd.cups-pdf	application/vnd.cups-raster	100	pdftoraster

(Note the change from 98 to 100).

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

@jamesbond I tried changing from 98 to 100 - still nothing. The processing since... in CUPS/jobs now shows as "finished" rather than loading XX%, but the printer doesn't do anything.

Attachments
xscreenshot-20240511T125623.png
xscreenshot-20240511T125623.png (130.1 KiB) Viewed 2123 times
User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

But that means dropping support for ALL old non-AirPrint-compatible printers. And since AirPrint is designed for networked printers, it also cripples USB printing

Like @LateAdopter said, Apple users will just buy more apple compatible stuff.

It strikes me that the CUPS developers have a vision of the future that will be at odds with the rest of the Linux world.

Perhaps CUPS' history of being a part of Apple is to blame. Maybe the developers are just getting on the newer is better bandwagon. I'm not sure about the broader Linux world. At puppy we like to make old stuff work forever, but I do know plenty of people / businesses are using much newer hardware than puppians need.
Driverless as a vision is great for new hardware. How many different threads did you @rcrsn51 make on the old murga forum for printer drivers and how to install them and make them work? For sure it'd be way easier to just have a printer connect to the network and away it goes. But I have printer hardware that is in excess of ten years old, and isn't dying any time soon (I hope), it won't work when CUPS decides to "upgrade" to AirPrint.

The very first laser printer I owned was a Star WinType 4000. It stopped working when WinXP came out, so I threw it out. I bought it when I was in high school, printed uni assignments on it in the 90s. Cost me $999. That was 25 years ago. I annoys me that that printer *MIGHT* have been able to work using linux through PCL compatibility. I don't want to be forced to throw out otherwise perfectly functioning hardware because the software doesn't like it any more (possibly why I still have a CRT TV).

jamesbond
Posts: 718
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 124 times
Been thanked: 402 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by jamesbond »

p310don wrote: Sat May 11, 2024 2:59 am

@jamesbond I tried changing from 98 to 100 - still nothing. The processing since... in CUPS/jobs now shows as "finished" rather than loading XX%, but the printer doesn't do anything.

Ah, too bad it doesn't work. That line forces cups to use gstoraster (from ghostscript) instead of pdftoraster (from poppler), assuming ghostscript is installed. If it still doesn't work, then the problem is elsewhere, unfortunately. To trace it further we need to figure out the exact difference of the cups pipeline, between fatdog and bookwormpup.

User avatar
mikewalsh
Moderator
Posts: 6185
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 803 times
Been thanked: 1994 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by mikewalsh »

@p310don :-

p310don wrote: Sat May 11, 2024 3:20 am

The very first laser printer I owned was a Star WinType 4000. It stopped working when WinXP came out, so I threw it out. I bought it when I was in high school, printed uni assignments on it in the 90s. Cost me $999. That was 25 years ago. I annoys me that that printer *MIGHT* have been able to work using linux through PCL compatibility. I don't want to be forced to throw out otherwise perfectly functioning hardware because the software doesn't like it any more (possibly why I still have a CRT TV).

.....and this is why I always say to anyone who has older (but still functional) hardware - which depends on older software to work properly - get a cheapo machine like a Chromebook, or a second-hand refurb (whatever fits the bill for you) to get online with.

Keep this 'standalone' machine up-to-date.

Keep your older hardware disconnected from the network, or only on the LAN if required.......and run your older hardware/software combination for as long as you want. After all, you're following the Unix/Linux philosophy here; do just one thing.....but do it as well as you possibly can.

One machine for online, one machine for that older hardware/software combo that does what you want. It's hardly rocket science is it..? :D

Mike. ;)

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by rcrsn51 »

@p310don Here is a thought - convert the PDF to a PNG graphic and send that to the printer. You can do the conversion in two steps.

pdftoppm aaa.pdf bbb
pnmtopng bbb-1.ppm > ccc-1.png

Then print the PNG from the command line through the Zebra CUPS filter with

lpr -P LABEL ccc-1.png

Make sure that the correct page size is selected in the CUPS printer settings.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

@rcrsn51 I am frustratingly at work at the moment. I have tried your PNG conversion to send to the genuine zebra, works perfectly fine.
Will try it when I get home on the china version and see how it goes.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

@rcrsn51 that does work on the chinese printer.

Code: Select all

pdftoppm labels_20240508200234.pdf bbb

splits the 11 page PDF into 11 individual files. I'm not familiar with pdftoppm, but if it could make it into a singular file to print out all pages all at once would be better. Or, the ppmtopng does all the files at once and then send the lot to the printer. With a little tweaking, that's do-able.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

GGGGGGGGGGGGGGGRRRRRRRRRRRRRRRRRRRRRRRRRRRR

I found a solution, working on your pdftoppm to png workflow @rcrsn51.

Code: Select all

find . -maxdepth 1 -type f -name '*.pdf' -exec pdftoppm -png {} {} \;

converts the 11 page PDF to 11 .png files.

Then simply

Code: Select all

lpr -P LABEL *.png

should work.

This is where the above GGGRRRR comes in. I pressed enter, it printed 1 and 1/2 labels and then I have run out of printer labels!!

So this is "SOLVED" but under the assumption it worked! GRRRR!! :)

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by rcrsn51 »

Excellent. I had forgotten that pdftoppm could also generate PNG files. Although I don't understand why you need the find command.

The advantage of this method is that it bypasses the gstoraster/pdftoraster filters that handled the PDF file inside CUPS and might have been the problem.

Instead, it uses the simpler imagetoraster filter because you have already converted the PDF into graphic form with pdftoppm.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

@rcrsn51 wrote:

Although I don't understand why you need the find command.

Well that's easy. Because I don't know what I'm doing, and I copy / pasted the code from another forum post and it worked!! I believe that thread was sorting out a mix of PDF and JPG files to convert them all to JPG. I changed JPG to PNG and it gave me the desired result.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by rcrsn51 »

You can probably just use: pdftoppm -png xxx.pdf label
That would make the set of PNG files named label-1.png, label-2.png ...
Then print them with: lpr -P LABEL label*.png

Last edited by rcrsn51 on Mon May 13, 2024 12:35 pm, edited 4 times in total.
User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

Yep, that does it too.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by rcrsn51 »

Are you making a run back to the shop for more labels, just to be sure that this all works? ;)

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by rcrsn51 »

It occurs to me that you could now print anything on a 4x6 thermal label by putting the content in an 800x1200 pixel mono PNG and sending it directly to the printer with CUPS-lpr.

Or you could code the content in ZPL and print it with "-o raw".

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

It occurs to me that you could now print anything on a 4x6 thermal label by putting the content in an 800x1200 pixel mono PNG and sending it directly to the printer with CUPS-lpr.

@rcrsn51 it doesn't need to be 800 x 1200, nor mono.

This screenshot is 1919x921 and in colour and printed just fine to the printer. Annoying, it can't print a PDF, but prints that!

Attachments
IMG_20240519_183437.jpg
IMG_20240519_183437.jpg (110.64 KiB) Viewed 1390 times
User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by rcrsn51 »

The two CUPS filters involved here - imagetoraster and rastertolabel - are doing their jobs, especially converting a colour PNG into mono so the thermal printer can handle it.

There is some subtle difference with how the CUPS in Fatdog handles PDFs internally that is specific to this printer. Maybe that's why the CUPS developers want to switch to all-AirPrint. It would standardize Linux printing and avoid these situations. Too bad if your Zebra-compatible printer doesn't do AirPrint.

I have been thinking about buying one of these just for fun. But there is huge price range in the knock-off models although they appear to do the same thing and are fairly simple technology. The reviews on some models are pretty bad.

User avatar
p310don
Posts: 365
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 72 times
Been thanked: 104 times

Re: Technical Differences in Printing Labels - LibreOffice vs PDF

Post by p310don »

All AirPrint is great going forward, just sucks for legacy compatibility.

I have been thinking about buying one of these just for fun.

I'm not sure what's fun for you. If fun is printing stickers to put on things, get a 2nd hand Zebra, works so much easier. If fun is getting difficult printers to work (I suspect you like this) then the chinese version is a lot more fun!

The original crux of this thread was to find out the difference between LO's printing and other straight CUPS printing. We don't really have an answer to that, except that LO does *something* just a little different that works, kinda, with this printer.
Then the focus changed a little to why Bookworm prints from PDF and FD doesn't. Again, BW does *something* just a little different that works with this printer.

A part of me wants to know what *something* is. Maybe it just needs to actual driver installed. But then another part of me realises how busy my life actually is, and I shouldn't be fiddling with this stuff. But that's the fun. Right?

For me to use this printer, in FatDog, to print PDF files, it's perfectly functional to do run this script in the downloaded PDF's directory:

Code: Select all

#!/bin/sh
pdftoppm -png *.pdf label
lpr -P LABEL *.png
rm *.png
rm *.pdf

Getting to this point has been fun :)

Post Reply

Return to “Users”