You are not logged in.

#1 2017-02-28 11:54:50

Alberto-Trujillo
Member
From: Poole, Dorset, UK
Registered: 2017-02-21
Posts: 70

[SOLVED] Virtual PDF printer: margins at the edge of a page

Hi everyone!
I have installed cups-pdf. When I send to print a document, the content goes to the edges; I can't set the margins.
I haven't found any solution in the Wiki or forum.
At the end I chose to create PDFs from a word processor Instead of a text editor.
Has anyone been able to fix this?
Thank you very much in advance.
-----
The system is updated (pacman -Syu)
XFce Desktop Environment
Installed HP Photosmart printer

Last edited by Alberto-Trujillo (2017-03-08 20:17:55)


"I believe I never knew what the word 'round' meant until I saw the Earth from space."
(Aleksei Leonov)

Offline

#2 2017-03-06 22:49:21

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

As an alternative to cups-pdf, have you tried adding gtk config files to allow you to "Print to File" (which includes pdf as an output option) from an application from the "File - Print" menu item ? For example...

/etc/gtk-3.0/settings.ini

[Settings]
gtk-print-backends = cups,lpr,file

/etc/gtk-2.0/gtkrc

gtk-print-backends = "cups,lpr,file"

Offline

#3 2017-03-06 22:59:24

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

As far as I know you can modify the ppd file used for the pdf printer to include margins. You can create a copy of the ppd and add a second printer if you want both options I think.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#4 2017-03-07 22:11:54

Alberto-Trujillo
Member
From: Poole, Dorset, UK
Registered: 2017-02-21
Posts: 70

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

Hi paulkerry and progandy,

Thank you for offering your help.
I'm new with linux and arch; Even though I've installed arch for only about three months, I'm learning a lot. But I have to ask to both of you,

Paulkerry: none of the two files you mention exist, should I create them?

Progandy: Where do I find the ppd file?

I appreciate your help, and while I wait for your answers I try to look for information on my own.

Thanks again: Alberto


"I believe I never knew what the word 'round' meant until I saw the Earth from space."
(Aleksei Leonov)

Offline

#5 2017-03-07 22:41:46

Alberto-Trujillo
Member
From: Poole, Dorset, UK
Registered: 2017-02-21
Posts: 70

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

Hello again progandy,
I found the ppd file.
I modified "Virtual_PDF_Printer.ppd" and "Virtual_PDF_Printer.ppd.O", like this:
*HWMargins: 20 20 20 20
But it has no effect on the documents I send to print.


"I believe I never knew what the word 'round' meant until I saw the Earth from space."
(Aleksei Leonov)

Offline

#6 2017-03-07 23:04:33

Alberto-Trujillo
Member
From: Poole, Dorset, UK
Registered: 2017-02-21
Posts: 70

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

Hi Paulkerry,
I created the two files that you tell me, and actually when printing to file, with pdf output I got a document with margins, thanks; but I have another question, how can I set the margin that I want?


"I believe I never knew what the word 'round' meant until I saw the Earth from space."
(Aleksei Leonov)

Offline

#7 2017-03-07 23:35:09

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

I just diffed my local files and found this. I think you have to modify the printable area of the paper format you want to print. Personally, I added a new format called "A4Bor" that adds 0.25in borders and a larger border at the bottom

--- /usr/share/cups/model/CUPS-PDF_opt.ppd
+++ /etc/cups/ppd/Virtual_PDF_Printer.ppd
@@ -76,6 +76,7 @@
 *PageSize A2/A2: "<</PageSize[1191 1684]/ImagingBBox null>>setpagedevice"
 *PageSize A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
 *PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
+*PageSize A4Bor/A4 Border: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
 *PageSize A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
 *PageSize AnsiA/ANSI A: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
 *PageSize AnsiB/ANSI B: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
@@ -146,6 +147,7 @@
 *PageRegion A2/A2: "<</PageSize[1191 1684]/ImagingBBox null>>setpagedevice"
 *PageRegion A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice"
 *PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
+*PageRegion A4Bor/A4 Border: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
 *PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice"
 *PageRegion AnsiA/ANSI A: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
 *PageRegion AnsiB/ANSI B: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice"
@@ -214,6 +216,7 @@
 *ImageableArea A2/A2: "0 0 1191 1684"
 *ImageableArea A3/A3: "0 0 842 1191"
 *ImageableArea A4/A4: "0 0 595 842"
+*ImageableArea A4Bor/A4 Border: "18 36 577 824"
 *ImageableArea A5/A5: "0 0 421 595"
 *ImageableArea AnsiA/ANSI A: "0 0 612 792"
 *ImageableArea AnsiB/ANSI B: "0 0 792 1224"
@@ -281,6 +284,7 @@
 *PaperDimension A2/A2: "1191 1684"
 *PaperDimension A3/A3: "842 1191"
 *PaperDimension A4/A4: "595 842"
+*PaperDimension A4Bor/A4 Border: "595 842"
 *PaperDimension A5/A5: "421 595"
 *PaperDimension AnsiA/ANSI A: "612 792"
 *PaperDimension AnsiB/ANSI B: "792 1224"

Last edited by progandy (2017-03-07 23:36:40)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#8 2017-03-08 16:14:15

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

Alberto-Trujillo wrote:

Hi Paulkerry,
I created the two files that you tell me, and actually when printing to file, with pdf output I got a document with margins, thanks; but I have another question, how can I set the margin that I want?

Yes about creating the files, but obviously you've already done that. You can only adjust the scaling, so @progandy's method might suit you better...

Offline

#9 2017-03-08 20:16:08

Alberto-Trujillo
Member
From: Poole, Dorset, UK
Registered: 2017-02-21
Posts: 70

Re: [SOLVED] Virtual PDF printer: margins at the edge of a page

Hi guys,
I have solved it in the two ways you have told me; I particularly like progandy's method,  because it is more flexible.
Many thanks to you both again.
Alberto


"I believe I never knew what the word 'round' meant until I saw the Earth from space."
(Aleksei Leonov)

Offline

Board footer

Powered by FluxBB