Bug 179804 - printing PDF files with page border does not seem to work properly
Summary: printing PDF files with page border does not seem to work properly
Status: RESOLVED WORKSFORME
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2009-01-06 15:02 UTC by doc.evans
Modified: 2018-10-27 02:21 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
a file that I want to print with border (63.52 KB, application/pdf)
2016-09-25 09:26 UTC, Ansa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description doc.evans 2009-01-06 15:02:06 UTC
Version:            (using KDE 4.1.3)
OS:                Linux
Installed from:    Ubuntu Packages

I receive PDF files in several smallish sizes (say, 6"x9" or thereabouts), and then print them on 8½x11 paper. Okular includes an option to print a page border. I expect that this option would then cause the file to be printed with a 6"x9" box around the contents (i.e., a border around the page, showing the location of the edges of the page) but in fact all that seems to happen is that a single horizontal line is printed above the text, in a position that seems to be completely disassociated with the text on the page (i.e., it does not correspond to the position of any page boundary).

This seems to be completely reproducible.
Comment 1 John Layt 2009-01-06 23:35:59 UTC
I guess this is using the 'Page Border' option in the Pages tab of the print dialog?  This border is actually added by the CUPS print system as a result of the setting in the common print dialog, rather than being added by Okular.

In printing PDF's from Okular there is actually a 2 step process in the background.  The first step is we take the requested options from the print dialog and ask the Poppler library to create a print file directly from the original PDF file, i.e. choosing which pages to print, etc.  We then send this print file to CUPS to actually print, where the border then gets added and any other CUPS options applied.

What I think is happening is that we are asking Poppler to create the print ps file with with the page size requested in the print dialog, i.e. a page size of 8½x11 with the original 6"x9" document centred in it.  When the ps print file gets passed to CUPS it then draws the border around the outside of the 8½x11 page rather than the original 6"x9" page, and as most of this border lies outside the printable area it only shows up as a line at the top.

What should probably be happening is that we ask Poppler to generate a print file with the original file's page size, then ask CUPS to print on the page size requested in the print dialog.  This should ensure that any CUPS options are properly applied to the print job.  The 'Print to File' option would still need to generate the requested page size.
Comment 2 doc.evans 2009-01-07 00:18:51 UTC
Yes, now that you've explained what's going on behind the scenes, it sounds like you're exactly right about what needs to be changed.
Comment 3 ietc 2009-07-14 01:00:46 UTC
I am coming from Bug #196590 where, apparently, an issue with margins was causing content to be cut off when printed from Okular.  As of the version of Okular that I am using, the margins issue seems much improved.  Two printed documents seem not to have had their content cut off, at least.

However, when I use the Pages per Sheet option the contents seem to be a bit too large, so the content is a bit cut off.  Could this be because the margins are wrong, or is it using the wrong page size?  Konqueror resizes the pages correctly to keep within the printable area.

I am not certain if this is related to this bug as suggested by Pino Toscano, Bug #196590 still, or something new altogether.  Should I open a new bug for this one?

Okular version 0.8.90
Using KDE 4.2.96 (KDE 4.3 RC2) "release 142"
OpenSUSE 11.1
Comment 4 jesslynne28 2011-03-16 01:36:12 UTC
So it's been a couple years..any progress on getting this bug worked out? If it's not going to ever be fixed, it probably shouldn't be in the options. But man I would love to see this working, I'm having a heck of a time finding a pdf reader that will print with a nice black border!
Comment 5 Albert Astals Cid 2014-05-10 18:27:04 UTC
Can you attach some of those "small" files your using?

Basically if i understand you correctly you want Print->Options->Pages->Page Border to not be around the page size you chose to print but around the page size the pdf file has?
Comment 6 Ansa 2016-09-25 09:26:23 UTC
Created attachment 101274 [details]
a file that I want to print with border

I am adding a file that contains a single page. This page is smaller than the A4 paper on which I am printing (in both directions) but no border gets printed.
Comment 7 Ansa 2016-09-25 09:28:06 UTC
> Basically if i understand you correctly you want Print->Options->Pages->Page
> Border to not be around the page size you chose to print but around the page
> size the pdf file has?

Yes, that is what I would imagine the option should do.
Comment 8 Andrew Crouthamel 2018-09-26 22:15:27 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Andrew Crouthamel 2018-10-27 02:21:47 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!