Sumatra PDF is a PDF, ePub, MOBI, CHM, XPS, DjVu, CBZ, CBR reader for Windows

Dymo LabelWriter 450 print size issue with command line

Hi all,

I have this weird issue that I couldn’t figure out on how to solve it.
I have set paper size to the correct size and saved it as print defaults.
When I did a print from SumatraPDF app, it printed as expected (see screenshot - right side label print).
But when I did this command line:
.\SumatraPDF.exe -print-settings “noscale” -print-to “Dymo LabelWriter 450” -silent .\LineNumber.pdf
I got an incomplete print where “LINE” word didn’t get printed at all, and the third line got cut off (see screenshot - left side label print).

Does anyone have any idea on how-to solve this cmd line printing issue?
SumatraPDF version is 3.2.64-bit
Thank you

using -silent can often mask error message problems so only use that if you must once a change has ben tested several times.

Order of CLI print arguments can sometimes unbalance the result, and it will rarely be the same as from print dialog.

The most likely reason for “trimming” is the “paper size” does not match the working print area.

Label printers are always a difficult one to get right, In the past it required a good driver to handle raw output. so search the forum for comments re Dymo and Zebra with “Seagull” . The pre-release has new options to handle odd paper sizes, first you can compare all the available numbers to use in settings with a command line PrinterInformation tool which is linked in Can support PaperSize Configuration · Issue #1812 · sumatrapdfreader/sumatrapdf · GitHub

Thank you GiHubRulesOK.

When I removed -silent, there’s no error messages.
If the “paper size” doesn’t match the working print area, I should have seen the print issue when I did the print from Sumatra PDF GUI, right? In my situation, I don’t see the print issue via the GUI. It’s only happening via the cli.

I also tried to find the driver by Seagull but it seems that they are not doing dymo anymore.
Here’s the website where I looked for the dymo driver: Free Printer Drivers | BarTender by Seagull Scientific

By the way, what did you mean by raw output?

Thank you

Sorry I agree. The Seagull driver works with Zebra and many others but not Dymo.

Printing from GUI is not the same as from Command Line, but in both case the (raw) page images are thrown at the driver, after SumatraPDF asked windows what the system default page size is. In the GUI that and other settings are modified by negotiation of various values.

SumatraPDF GUI by default (from the over-ride in the advanced settings file) starts with “shrink” to paper size . So if you check that first, to see which works best and which don’t, you can then decide on shrink fit or noscale on command line.

Then paper size is the next problem. In the GUI it will be changed by the printer driver dialog but there is no print dialog unless you deliberately call it from the command line.
CLI printing starts with the system DEFAULT printer paper size (often letter or A4, depending on windows locale, not normally a small label size) so the print is often offset from the working area. IF the default printer is the DYMO and if its DEFAULT paper size is the ONE label type that should work. The CLI alternative is to confirm exactly which paper size is needed and in latest pre-release that can be a numeric “paperkind=” which allows setting those less common sizes

The last problem is rotation as SumatraPDF in both GUI and CLI uses autorotate, but the output scale will differ based on the paper size ratio long to short. So the 90 degree over-ride is NOMINALLY called portrait and landscape but that is not to be taken literally. Just accept one will be contents rescaled at 90 degrees to the other and either could be upside down.

Thanks again for the explanation.
I already have my Dymo as the default printer and have set the proper default paper size but whenever I did the CLI print, it always output that bad print out, which is baffling.

One thing I noticed though is the Paper size in Properties and Advance Options are different (I don’t know why):

The correct size is the one in Advanced Options.
So in the pre-release build, it has this paperkind. In my case what would be the value of paperkind? This Dymo Large White Shipping Label is 2 5/16" x 4"

Thank you again for the help!

Every pc builds its own list of paperkinds when printers are added and removed.
That’s why I cannot say which number is 30252 or 30256, however, oddly they are sometimes similar to those last 3 digits, but guess that’s coincidence. Its also likely that two users in the same room or otherwise could have different numbers for the same size ! Most rare for them to change for a single user, unless messing about with new forms or printers.

Here are a few from my Print to PDF today, but using paper=A4 or A5 is the max stability for CLI, those lower numbers 9 and 11 are fairly universal for most windows users around the globe, but its not guaranteed.

A4 (9) (11.69x8.27) (296.93x210.06)
A5 (11) (8.27x5.83) (210.06x148.08)

FOR the following I need to use paperkind=127 to print in the right column and 128 to print in the left column, but note although both of them are paper=A4 I cant use A4RH reliably but it does work sometimes with “paper=A4RH” (Note the different margins are stored in windows printer formats) For Japanese pages I need to use paperkind=12 or 13 but again with latest version “paper=B4 (JIS)” will often work whereas it did not before. Thus you could try -print-settings "paper=30256 Shipping"

B4 (JIS) (12) (14.33x10.12) (363.98x257.05)
B5 (JIS) (13) (10.12x7.17) (257.05x182.12)
A4RH (127) (11.69x8.27) (296.93x210.06)
A4LH (128) (11.69x8.27) (296.93x210.06)

Your common American sizes are also well fixed but SumatraPDF will default to “Letter” as the most acceptable locally. That is what will probably be applied unless forced otherwise, which is generally done via the print dialog.

Using PinterInformation you can ask for the list stored for the dymo printer and hope the names show as 30256 then look for paperkind (###) but that will only work with a recent pre-release copy of SumatraPDF built after that long GitHub discussion about how to make a change from book size pages.

so here is 127 output (the default would be large on the whole page)

sumatrapdf -print-to "Microsoft print to PDF" -print-settings "paperkind=127" Input.pdf

And if that was set to auto save without prompting as the currently viewed file in sumatraPDF I would instantly see this, To control the position to upper or lower I would need to add to windows those 2 different page layouts which would then have different numbers.

image

Thanks GitHubRulesOK.
Hmm… I tried the pre-rel but still didn’t work. I did use “paper=30256 Shipping”
I think I need to do PrinterInformation that you mention.
Is that an SumatraPDF cli option? Or a standalone app?

Thanks again!

NOTE the date of that discussion was AFTER the static pre-release so function is only in the DAILY BUILD

The Open source Tool was written by JensBejer but in that thread he provided a dropbox link to a compiled copy of both his pre-release which has now been added into official dailys and also his stand alone printerinformation tool to get paperkind. It takes only a short while to try out the options but I found it informative as I never knew there were so many fax pages.

Oh woww… I just tried the daily build.
I used the paper argument just like you mentioned. And it worked!
Hope to see this feature in the official build soon.

And regarding the PrinterInformation tool, I did see that dropbox link in that thread.
Thanks!

1 Like