Print to label printer but orientation is not correct


#1

Hi,

I’m using SumatraPdf to print a pdf (barcode) from the command-line on a labelprinter (Toshiba B-EV4T-GS14-QM-R)
This works but the problem is that the barcode is printed from bottom-to-top instead of from left-to-right.
When I print from the command-line to the Adobe Reader then the ticket is printed from left-to-right (but I do not want to use Adobe because it leaves the Reader open and I want a complete silent print).

I use sumatrapdf.exe -print-to “TEC B-EV4 (203dpi)” “c:\tmp\test.pdf”

I also tried to add -print-settings noscale but then I get a blank printout?

Can someone give me a hint how I can print this barcode with Sumatra by command-line

Thanks
Didier


#2

This is a common issue with blind printing, but can usually be stabilised.

Position is often affected by scale when the source is not clipped, what is the printer default work area (say 4" x 2"?), what does SumatraPDF think the source pdf dimensions are (menu file properties)

Basic fit shrink and noscale will move the relative centres (possibly throwing print area outside printable area)

Depending on version there are other effects such as rotation, which version are you using?


#3

Sumatra thinks it’s 5,01 x 2,5 cm
The labels are 14 x 5 cm but it looks like the printer defaults maximize on 11,2 x 5 cm.

Sumatra version = v3.1.2

Regards
Didier


#4

Sorry other tasks interrupted

Looks like first test is try adding fit (enlarges) to command line so

sumatrapdf.exe -print-to "TEC B-EV4 (203dpi)" -print-settings "fit" "c:\tmp\test.pdf"

if it fits correctly but you don’t want it enlarged we may have to try some other way to fix page size


#5

Hi,

I do not understand your comment “Sorry other tasks interrupted” but ok
It looks like this -print-settings “fit” makes my print a bit smaller, on the right side of the print I loose a few stripes from my barcode.but it’s still printed from bottom-to-top

Isn’t there some way to rotate the printing? Or some Orientation setting?

Regards
Didier


#6
sumatrapdf.exe -print-to "TEC B-EV4 (203dpi)" -print-settings "fit,portrait" "c:\tmp\test.pdf"

You can also try combinations with landscape in place of portrait to see how it varies and permutations of both with shrink in place of fit (the alternatives to noscale)


#7

hmmm, I tried with “fit,landscape” and with “fit,portrait” but no change in the printing.
The barcode keeps printed from bottom-to-top?
strange? As far as I can see I have the latest version so that can not be the problem.
Do you have some other possible solution?

I also looked what the dimensions are in Adobe and that’s the same as SumatrPDF thinks (5 x 2,5 cm)
So why does SumatraPDF prints the barcode 90° rotated?

regards
Didier


#8

also tried “shrink,portrait” and “shrink,landscape”.
All the same result?


#9

Deepest apologies I may have misled about rotation since it now see it may have been added after version 3.1.2 please try with latest portable from here https://www.sumatrapdfreader.org/prerelease.html

the acceptable values are all lower case and can be one of three options for each
unfortunately those values clash with other printer negotiation

[noscale|shrink|fit] and [autorotation|portrait|landscape]

One way to try and override issues is in settings.txt file try change the default shrink or fit value (noscale may need to be = none)

The other way to try and force printer to accept the data as sent is set the printer default values by first copy the printer to another name and change its settings to suit the incoming data so change from auto rotation in 2nd printers own definition.


#10

Not sure if I understand everything correctly BUT with the prerelease and adding the printer-settings “landscape” it works :grinning:
So I didn’t change anything to the settings-file, I just use the command
sumatrapdf-prerelease-11105.exe -
print-to “TEC B-EV4 (203 dpi)” -print-settings “landscape” “c:\tmp\test.pdf”

The problem that I have now is that when i do ‘arrow-up’ and ‘enter’ to print another ticket from the same cmd nothing happens? Is that a bug in the prerelease?


#11

Is there some possibility to get debug-information from SumatraPDF to see what can go wrong?


#12

When i try a few times more (and also dit some ‘print test page’ from the printer properties - this always prints) I notice that sometimes the same command prints and sometimes it does nothing?
Have you also noticed that in the prerelease? Any idea?


#13

After a few tries I get a msg that Sumatra has crashed --> that can be helpfull for you I gues
How can I provide you that file? (If you want it)


#14

Personally I cant see the file

@kjk did you get a crash report ?

@Didier I have never noticed a “hang” or crash from a resend, nor have others reported it, however it is always possible to be a new bug.

From past knowledge some printers expected an intermediate handshake between pages (back in the days of steam it was a simple form feed)

One trick to clear the print buffer was to
DOS>copy “ctrl char in a 1byte file.txt” prn
However I have not had to do that over the past couple of decades.

I suggest

  1. try a different type of test file.
  2. does it only happen with landscape? can “wrong ways” prints without that setting repeat without error
  3. does it work with two settings e.g. -print-settings “fit,landscape”

#15

What do you mean with @kjk did you get a crash report ?
I didn’t send that report? How can I send it?


#16

kjk is the developer he sees any report that is sent via program


#17

Now I’ve tried multiple things.
The version 3.1.2 always works but there my barcode is always printer from bottom-to-top
The prerelease versions (32/64) sometimes work (most of the time they don’t.
Sometimes with no message (and no print), sometimes with msg crash, sometimes the process keeps hanging (saw that in the task manager), also had some other situations/messages

So I guess that the prerelease is surrely not stable enough.

That brings me back to the official release 3.1.2.
What can I try there to make the print work fine (print from left-to-right) because there I can’t set the landscape

Also, is it possible that suddenly I do get a splash-screen when using "SumatraPDFPortable.exe -print-to “TEC B-EV4 (203 dpi)” c:\tmp\myticket.pdf
As far as I remember I didn’t had that splash-screen in the past (I can be wrong!, if I’m wrong can I prevent that from showing)

regards
Didier


#18

Aha, so the program always sends a message to you if there is a problem?
Strange…


#19

What I also notice is the following.
I have the official release 3.1.2 from the portableapps website.
I already used that for many years.
Now if i call the SumatrPDFPortable.exe with the command-line that I previous provided it works but botom-to-top.
If I first start the SumatraPDF.exe (that exists in the Apps-directory) and I open the same pdf in there and I print that pdf with the print-icon then my printer gets in an error-state?? No idea why? I do not get any information about that.

So I wonder, could you provide me a PortableApps installation of that prerelease?
Maybe that will resolve my problem.
Remark: I tried both from the cmd and then they both work??? I really do not understand anymore…

Now what I also notice that’s when I open the app/SumatraPDF/SumatraPDF.exe and I look at my printer preferences another paper-size is selected then the default paper-size.
I think that will be the reason for the error-state.
Is there some way to also provide the paper-size through the cmd? (i guess not)


#20

I do not know when reports are sent but understand the prerelease should have that ability It may depend on other circumstances (e.g. you need to be on internet).

If the command is wrong it may trigger screen check the " positions
“path\exe” -options “option,option” -Another-Option “path with spaces \filename”

To override screen there are other switches especially -silent see https://www.sumatrapdfreader.org/docs/Command-line-arguments.html

Finally if you need to stick with 3.1.2 (no CLI rotation) then the fall back is to FIXATE rotation in the default system printer so that the rotation is the DEFAULT one