Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to printing a PDF Label (Width > Height) in command line? (Width:57mm, Height:32mm) #972

Open
yinsenf opened this issue Feb 10, 2018 · 10 comments

Comments

@yinsenf
Copy link

commented Feb 10, 2018

Tried it on the command line and the UI cannot be printing it in a label completely, fits all the page.

Used parameters:
-print-settings "noscale,monochrome,2x "
-print-settings "noscale,monochrome,landscape,2x "

Label Size is
Width: 2-1/4 inch (57mm)
Height: 1-1/4 inch (32mm )

Printer:
DYMO LabelWriter 450 Turbo

Here is an attachment for demo label in PDF file.

demo-label.pdf

Thanks~

@GitHubRulesOK

This comment has been minimized.

Copy link

commented Feb 12, 2018

its always difficult to track down printer scaling issues as each user may have different default settings

your print settings in "SumatraPDF-settings.txt" could include one of these 3 that over-ride the settings in the Print dialog

PrinterDefaults [
default value for scaling (shrink, fit, none)
PrintScale = shrink

Thus I "think" you may need to change "shrink" to "none" to remove the possibility that is interfering

I would also check the default settings in the printer driver (from start menu system printers and faxs)
i suggest it should look similar to this ....

untitled

If either changing defaults in driver or sumatraPDFsettings file solve your problem please let us know for the benefit of others

@yinsenf

This comment has been minimized.

Copy link
Author

commented Feb 14, 2018

@GitHubRulesOK
Tried 2 places (SumatraPDF-settings.txt and Printer setting) but a still same result.
Label printed only shows left half side when used "landscape" setting
Or vertical cross 2 labels when without "landscape" option

BTW, I think "PrintScale = shrink" equals "noscale" in -print-settings.

@colinmollenhour

This comment has been minimized.

Copy link

commented Feb 14, 2018

Did you try "noscale,portrait,monochrome,2x"? Without specifying "portrait" explicitly I believe it will default to rotating 90 degrees when width > length. Also for "portrait" or "landscape" to have any effect you need to build your own binary since the latest release is quite old and doesn't include the update that added support for these flags. I just built it recently so can share my build with you if you like, but to be safe you should never take binaries from strangers.. 😁

@GitHubRulesOK

This comment has been minimized.

Copy link

commented Feb 14, 2018

@fengys thanks to the reminder by @colinmollenhour
portrait should be exposed for use by latest beta pre-release or the alpha binaries
http://www.sumatrapdfreader.org/prerelease.html

also double check spellings as it is easy to get Portrait in one part of the documentation mixed with portrait in another and SumatraPDF usually will only respond to the exact syntax

@yinsenf

This comment has been minimized.

Copy link
Author

commented Feb 15, 2018

portrait doesn't work at SumatraPDF-prerelease-10766.exe, as the same result as landscape option.
Maybe have to wait for next prerelease version. But since last time try to make it works was one year ago...
Love SumatraPDF very much, lightweight, portable and developer friendly.
Thanks!

@colinmollenhour

This comment has been minimized.

Copy link

commented Feb 15, 2018

Yeah the pre-release should already contain the commit I was referencing (5d254b7), thanks for the link @GitHubRulesOK.

@yinsenf

This comment has been minimized.

Copy link
Author

commented Mar 16, 2019

after 2 years still stuck on this issue. Ha
Tried latest version, but nothing output.
Here is my command:

SumatraPDF-prerelease-11105.exe demo-label.pdf -print-settings "noscale,portrait,monochrome" -print-to "DYMO LabelWriter 450 Turbo"

I'm not sure is prerelease version included this patch?
Thanks

@GitHubRulesOK

This comment has been minimized.

Copy link

commented Mar 16, 2019

Hi again
Most recent tests by others seem to indicate there a problem with most recent pre-releases (I as a user, do not compile so cannot test any internal shortcomings)
My own tests suggest that there is currently a lack of rotation control due to the way that windows exposes the drivers default values combined by the way SumatraPDF queries and responds to those values. Apart from virtual printers I only have a standard Portrait A4 device to use for testing.

Thus if you cannot make changes to the internal print components my best suggestion was always to try to change default printer default settings, but recently with windows 10 I have not found a working technique. In theory if the input is the correct rotation and position "within a portrait frame" then without scaling the output should at worst end up in the correct print area as long as the printer does not object to the excess white area.

@yinsenf

This comment has been minimized.

Copy link
Author

commented Mar 17, 2019

If parameters without portrait it can print out the label but rotated 90 degree, if portrait in the parameters, nothing happened..

@GitHubRulesOK

This comment has been minimized.

Copy link

commented Mar 17, 2019

If I were at your location I would be testing the following, there is no guarantee that a printer will accept the following but its worth the try, it may help to have a simple gridded image (with some identifiable corner text (A B C D) as the source so you can compare any differences in scaling by measurement of the output

The aim is to find for a given device (dymo lable etc) a working print area that works from a given page shape Avoid specifically calling it portrait or landscape.

Take an image that works well even if its 90 degrees when sent to the printer into an editor and look at the native page size and horizontal to vertical ratio
Keep the page shape the same BUT rotate the image contents by 90 degrees this is what most people complain they see happening (truncation of one side etc.)
Send that image to the printer and the output should be the right way up even if its not as desired

Now for the hard part scale up the page size in the editor so that the horizontal to vertical ratio is maintained but the long side length is used for the short side and the long size becomes even longer
now when you rotate the core content it is not truncated send that to the printer without any scaling is it is likely that the image is not in the correct position so you need to move the location of the desired image area to a place on the page that matches the printers default settings. that may be affected by fit/no scale/scale so check for any differences and discard those that aggravate the desired scale of output.
Based on the misplacement of the correctly scaled result move the page content to match the paper shape.
At this point you should have a workaround solution that requires adding an image source to a larger canvas at a known position.
Depending on those observations you may be able to now adjust some image source page settings or print driver page setting to suit the necessary size scale position and orientation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.