Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So, I have the following setup:
- desktop computer running Xubuntu 19.10
- cups 2.2.12 installed with one network Canon MF8280Cw printer installed in 2 variants:
- one time lpd://ip.ad.re.ss
- one time socket://ip.ad.re.ss
I have a custom document that I need to print, meaning the label.pdf from the attachments. The document is a mask that should be printed on a given transport label that I receive from our transport partner and has a size of 167 mm x 102 mm.
No matter what settings I am trying to apply all I manage to print out is looking like the print.pdf, only the lower part of the initial document gets printed out... on what seems to be the right xasis positioning... top part is chopped off...
What is also very strange is that the printer is not trying to split the job on different pages and after printing the first one...
You can also see my print settings, although I have also tried other ones.
I do not know what to try... I have the feeling that I should declare the custom paper size in the settings of the printer, but I am not sure and I do not know in what direction I can research more about this.
My google fu is also not helping at this moment.
From another computer with Windows I can print the document, but there I can declare the custom size of the paper in the printer properties. Here in Linux, this custom size is visible only in the print dialog of the pdf document viewer and I cannot declare it in Cups or anywhere in the printer properties.
I have also tried 2 different pdf viewers: Atril and Gnome Document Viewer.
Another thing: on the printer itself I have declared this type of custom paper size and I can declare in which tray I have fed the custom size paper. When printing from the windows machine the printer takes automatically paper from where I have declare that it is. When printing from Linux every time, I get an error on the printer (or a warning) and I have to manually specify (on the printer) from where it should take paper. The result, as said is like the one from print.pdf
People usually give width by height; so A4=210 x 297 mm.
167mm x 102mm sounds like it's wider than long. Something in the print chain defaulted to landscape when I tried that, turning the page sideways. The solution to that is to set the page square (167x167) or even longer. when the label finishes, the printer is given a for feed which ejects it, so the length doesn't actually matter, as long as you know the stuff being printed isn't longer.
If your app accommodates it, set up a square custom page. The printing chain is:
PDF viewer --> cups --> ghostscript & ppd --> printer
The further left you can set the custom page, the better. You may have to set it on pdf viewer and cups. If it's giving headaches, set it as default.
People usually give width by height; so A4=210 x 297 mm.
167mm x 102mm sounds like it's wider than long. Something in the print chain defaulted to landscape when I tried that, turning the page sideways. The solution to that is to set the page square (167x167) or even longer. when the label finishes, the printer is given a for feed which ejects it, so the length doesn't actually matter, as long as you know the stuff being printed isn't longer.
If your app accommodates it, set up a square custom page. The printing chain is:
PDF viewer --> cups --> ghostscript & ppd --> printer
The further left you can set the custom page, the better. You may have to set it on pdf viewer and cups. If it's giving headaches, set it as default.
Thanks for the idea, I will try it. Cold you eventually tell me more of how I could declare a custom paper size in cups?
On PDF viewer I can do it, the same on the printer... the ghostscript & ppd is pretty difficult to alter as it receives mainly data and passes it forward...
Quote:
If you print to pdf first and then take the resulting file and print it, is there any difference with printing behavior?
This is already a pdf... although generated with PyFPDF... would this make any difference? should I pay attention to something special while doing this? sorry I am asking this cause I do not see any difference and I would like not to miss any detail, that might look insignificant and which actually matter...
You could tweak the image to trick it into printing in the desired space. You could tweak the ppd to favor your custom size. YMMV. Certain label types have "templates" that can be used. I'm not sure how you'd use those in linux. I normally take the dots per inch specification of the printer and do the math. With 25.4mm per inch it's not that difficult to figure out. Or close guess / trial and error it.
If you don't need repeatability, you could take a sheet of graph paper (grid lines) and tape the label to it to favor the area that gets printed. Depends on the printer I guess, some favor particular paper thicknesses and aren't very flexible.
If you don't need repeatability, you could take a sheet of graph paper (grid lines) and tape the label to it to favor the area that gets printed. Depends on the printer I guess, some favor particular paper thicknesses and aren't very flexible.
For now I have an intermediate solution where I am printing on predefined A4 pre-cutted labels that I am sticking afterwards on the transport label. Unfortunately this is covering only the consignee field and I need to fill in by hand the customer number, the date and the dispatcher details. For the latter one I have a stamp so its not such a big issue.
So "engineeringly" speaking I am covered with a solution that resolves 80% of the problem and the actual topic is only a learning issue.
Thanks for the idea, I will try it. Cold you eventually tell me more of how I could declare a custom paper size in cups?
On PDF viewer I can do it, the same on the printer... the ghostscript & ppd is pretty difficult to alter as it receives mainly data and passes it forward...
Ok, http://localhost:631
Printers --> your printer --> properties, or something like that. I spotted your pics at the bottom. 167x102 is probably going to turn the page 90 degrees, print landscape, and run off the end of the page.
Set 167x167 if that (167x102) is your paper size. There's a compulsory margin around most printers of minimum 0.5" (~12.7mm), = 25.4mm left/right and top/bottom. It may be larger on some. But you can usually shrink output to fit.
Ok, http://localhost:631
Printers --> your printer --> properties, or something like that. I spotted your pics at the bottom. 167x102 is probably going to turn the page 90 degrees, print landscape, and run off the end of the page.
Set 167x167 if that (167x102) is your paper size. There's a compulsory margin around most printers of minimum 0.5" (~12.7mm), = 25.4mm left/right and top/bottom. It may be larger on some. But you can usually shrink output to fit.
I know how to reach CUPS and to look into settings, but in the administration part I did not found where to define custom paper size.
Defining a 167x167 custom size did not helped: when I print portrait I get only the left part of the document, when I print landscape I get the same result as before.
I also thing it is a "type mismatch" somewhere, a kind of autorotate that functions when it should not be on the entire printing chain. I say this because the printer throws me an error every time when I am printing on the custom paper size. Normally if the printer matches the size of the document with a paper size its taking it automatically. In my case the printer blinks red and asks me to choose a paper size on which to print the job. Since the print preview is ok, I think further down on the "pipe to the printer" the thing gets one more time rotated... would be interesting to find where, and I do not know how I can investigate...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.