| <<<Back 1 day (to 2020/05/18) | Fwd 1 day (to 2020/05/20) >>> | 20200519 |
Vanscot | Howdy! | 15:33.00 |
chrisl | Hi | 15:34.13 |
ghostbot | Welcome to #ghostscript. If you have a question, please ask it, don't ask to ask it. Do be prepared to wait for a reply as devs will check the logs and reply when they come on line. If you are looking for help or infomation about MuPDF, try the new #mupdf channel. | 15:34.13 |
Vanscot | I have a question about command line pdf manipulation, not sure if this is the correct channel as it's not realted (for now) to gs. | 15:34.41 |
chrisl | Well, then, no, not really the right channel! But ask, we'll help if we can | 15:35.20 |
Vanscot | I want to add a footer to every page of a pdf file, it's a picture (png/svg/jpg) and a few lines of text by said picture. | 15:35.44 |
| I've searched quite a lot and only found pdftk examples but it's not available as a package for centos | 15:36.34 |
| And part of the problem was normalizing page sizes of said PDF, which I managed to do using pdfjam | 15:37.03 |
| But now I can't find a way to either overlay a pdf file with the footers over the original or just directly apply a footer to every page of the original pdf. | 15:38.18 |
kens | Well, depending what you mean by 'normalise' for the page size, and depending on the format of the images, you *could* do what you want with Ghostscript and the pdfwrite device, probably | 15:39.03 |
Vanscot | And I don't know where to look for info anymore. (Official pdfjam pages have some sort of docs, pdftk has multiple rpm sources which makes me doubt about them) | 15:39.25 |
kens | Also depends what you mean by 'overaya' | 15:39.32 |
Vanscot | Sorry, english is not my primary language | 15:39.52 |
| xD | 15:39.53 |
kens | It doesn't seem to mine either judging by the typos :-( | 15:40.17 |
Vanscot | Basically, I wanted to check the size of every page and resize the whole pdf to the highest values found | 15:40.53 |
| I managed to do so using pdfjam and even add some space for a footer. | 15:41.10 |
kens | You could write a piece of PostScript which would draw image(s0) and text at a specified location on a page. If you have already processed a PDF page, and output the result to pdfwrite, then you will get a PDF file where the page comprises both sets of content | 15:41.29 |
| Ghostscript and the pdfwrite device can also resize the content to fit a defined media size (Note the scaling has to be the same in both directions) | 15:42.03 |
| So you can define a fixed size, specify 'fit' to the device, and then define a /EndPage procedure which will draw additional content at the end of every page. | 15:42.36 |
| This 'sounds like' what you want to do | 15:42.58 |
Vanscot | It does sounds like... | 15:43.07 |
| What I want to do. | 15:43.13 |
kens | There are caveats | 15:43.16 |
| You would have to write the EndPage procedure in PostScript | 15:43.37 |
| Which is not a well known language nay more | 15:43.44 |
| and has no transparency model. | 15:43.55 |
| The Ghostscript PostScript interpreter does support at least some transparency, but its non-standard | 15:44.21 |
| So if you want the additional content not to be opaque that would be trickier | 15:44.37 |
| PostScript also doesn't read svg or png | 15:44.48 |
| So if you wanted to use those image formats it would be harder | 15:44.57 |
Vanscot | I see... | 15:45.10 |
kens | There are some examples that partially address what you are discussing on Stack Overflow, and you could always ask the question there. | 15:45.53 |
| I suspect pdftk might be better for what you want to do though | 15:46.06 |
Vanscot | Seems that way, but since it's not on the official centos repos I'm reluctant to use it. | 15:46.59 |
kens | I imagine the Ghostscript version supplied by CentOS is ancient too | 15:47.21 |
| Oh apparently its 9.25, so that's only 18 months, much better than I'd have expected | 15:48.20 |
chrisl | The status of pdftk is a bit confusing - I have a feeling it may have morphed into a commercial only product | 15:48.33 |
kens | I guess that's possible, I don't really follow it | 15:48.55 |
| Well they claim there's a free version, but it does look commercial now yes | 15:49.28 |
chrisl | It seems to have been dropped by all the main Linux distros which usually suggests a licensing conflict | 15:50.20 |
Vanscot | :/ | 15:52.09 |
kens | Not a good sign | 15:52.25 |
| Well, there are answers on Stack Overflow regarding 'staping' the output, so you could look at those for how to write an EndPage procedure with Ghostscript. I'm reasonably sure there are answers regarding -DFIXEDMEDIA and -dPDFFitPage as well | 15:53.17 |
| Put those together, and you'd have the bare bones of a solution using Ghostscript | 15:53.35 |
Vanscot | I'll look into it. | 15:57.03 |
| Thank you all! | 15:57.27 |
| :) | 15:57.28 |
kens | NP | 15:57.34 |
| <<<Back 1 day (to 2020/05/18) | Forward 1 day (to 2020/05/20)>>> | |