LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 03-25-2020, 10:18 AM   #1
beje
LQ Newbie
 
Registered: May 2018
Location: Austria
Distribution: Xubuntu
Posts: 14

Rep: Reputation: Disabled
Problem with printing on custom size paper


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

Any hint? Any idea? Thank you very much!
Attached Thumbnails
Click image for larger version

Name:	print-settings-1.png
Views:	103
Size:	39.4 KB
ID:	32859   Click image for larger version

Name:	print-settings-2.png
Views:	104
Size:	66.3 KB
ID:	32860  
Attached Files
File Type: pdf label.pdf (1.3 KB, 101 views)
File Type: pdf print.pdf (337.1 KB, 101 views)
 
Old 03-25-2020, 01:19 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,141

Rep: Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272
A Few things:

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.
 
Old 03-25-2020, 07:19 PM   #3
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 4,253

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
If you print to pdf first and then take the resulting file and print it, is there any difference with printing behaviour?
 
Old 03-26-2020, 06:53 AM   #4
beje
LQ Newbie
 
Registered: May 2018
Location: Austria
Distribution: Xubuntu
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
A Few things:

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...

Thank you!
 
Old 03-26-2020, 07:16 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,030
Blog Entries: 1

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
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.
 
Old 03-26-2020, 07:23 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,030
Blog Entries: 1

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
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.
 
Old 03-26-2020, 10:07 AM   #7
beje
LQ Newbie
 
Registered: May 2018
Location: Austria
Distribution: Xubuntu
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
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 thoughts though!
 
Old 03-27-2020, 04:07 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,141

Rep: Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272
Quote:
Originally Posted by beje
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.
 
Old 03-30-2020, 10:05 AM   #9
beje
LQ Newbie
 
Registered: May 2018
Location: Austria
Distribution: Xubuntu
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
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...

thanks for all the ideas so far!
 
Old 03-30-2020, 01:49 PM   #10
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 4,253

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
It is possible to run the printing filter chain manually, and that is explained here...
https://wiki.ubuntu.com/DebuggingPrintingProblems
and
https://fedoraproject.org/wiki/How_t...ilters_by_hand

To get the filters used for a particular print job, you can put CUPS into debug mode with
Code:
sudo cupstctl --debug-logging
Send a print job and then run something like
Code:
sudo grep -iA3 filters /var/log/cups/error_log
Example...
Code:
D [31/Mar/2020:07:43:55 +1300] [Job 42] 2 filters for job:
D [31/Mar/2020:07:43:55 +1300] [Job 42] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [31/Mar/2020:07:43:55 +1300] [Job 42] brother_lpdwrapper_mfcj3530dw (application/vnd.cups-pdf to printer/MFCJ3530DW, cost 0)
D [31/Mar/2020:07:43:55 +1300] [Job 42] job-sheets=none,none
 
Old 03-31-2020, 04:09 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,141

Rep: Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272
So it is turning the page and printing landscape? Have you considered LYING as a solution.

Set in in landscape, set the size as 102x167 and it will probably turn it to portrait. Do nothing to the printer
 
Old 04-01-2020, 05:45 AM   #12
beje
LQ Newbie
 
Registered: May 2018
Location: Austria
Distribution: Xubuntu
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
So it is turning the page and printing landscape? Have you considered LYING as a solution.

Set in in landscape, set the size as 102x167 and it will probably turn it to portrait. Do nothing to the printer
yes, I think I can play with this. I will see when I will have time to resume this as this playing with the printer is not so time friendly...

thanks for the suggestions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To create custom media (Paper Size) jaapee Linux - Newbie 1 02-12-2014 05:30 PM
scale to full paper size in kpdf printing Snigger Linux - General 0 05-05-2010 09:04 AM
kde4 printing does not honour paper size selection bimboleum Slackware 7 10-04-2009 03:17 PM
Setting default paper size for printing? Dox Systems - Brian Solaris / OpenSolaris 3 02-27-2008 03:16 PM
A Printing Question on default paper size steve_f60 Linux - General 1 08-18-2005 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration