| <<<Back 1 day (to 2019/01/23) | 20190124 |
sebras | can I ask for a review of http://git.ghostscript.com/?p=user/sebras/ghostpdl.git;a=commitdiff;h=ed0d754ad3f7dd222dfa66f016d68308b80bd1c8 please? | 03:17.08 |
challenger | Hi! | 06:55.34 |
chrisl | sebras: LGTM (ed0d754ad3 that is) | 08:47.57 |
JoshG | Hey | 13:47.22 |
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. | 13:47.22 |
JoshG | I am having some issues with a command I wrote before that worked but after updating ghostscript to 9.26 no longer works correctly | 13:50.16 |
kens | What command, what issues ? | 13:51.16 |
JoshG | gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=out.pdf -c "<< /BeginPage { 2 mod 1 eq {13 -10 translate} {50 rotate} ifelse } >> setpagedevice" -f in.pdf | 13:51.25 |
| It is meant to translate even and odd pages differently | 13:51.46 |
| I have replace the one translate with a rotate to make it more clear what is happening but it looks like the rotate happens on every page | 13:52.21 |
| It seems the beginpage is passing 0 every page instead of the number of times it has run | 13:53.23 |
kens | I don't believe that command will work with PDF input. I'm doubtful it ever would have worked. The reason is that teh PDF interpreter issues a setpaegdevice call at the start of every page, in order to set the media size. One of the actions of setpagedevice is to reset the page number. So *every * page is the first page. | 13:53.36 |
JoshG | thats strange. It was written in 2015-2016 and it has worked since then (no package updates till now) | 13:54.59 |
kens | The PDF interpreter has worked that way for a long time, but its possible the package maintainer changed something in what they shipped. You would have to take this up with the package maintainer, not us. | 13:56.02 |
| Possibly you were on a very old version before, I wouldn't know. | 13:56.14 |
JoshG | Is there another option for changing every other page? | 13:57.22 |
kens | You would have to track the page numering yourself | 13:57.49 |
JoshG | I am not to familiar with postscript. could you point me in the right direction? | 14:00.26 |
kens | You need to create a dictionary of youw own in userdict, eg "userdict begin /MyDict 5 dict def end" | 14:02.04 |
| "userdict /MyDict get /Initial 0 put" | 14:02.36 |
JoshG | Thanks. I will do some reading and see if I can figure it out | 14:03.29 |
kens | Then at each BeginPage: "userdict /MyDict dup get /Initial get 1 add /Initial exch def" | 14:03.44 |
| That (should) increment /Initial on every call to BeginPage. | 14:04.05 |
| You can then use the value of /Initial to determine what page you are on. | 14:04.18 |
| I'd write more of it, but I'm in the middle of debugging a problem | 14:04.51 |
JoshG | Thanks so much | 14:08.05 |
kens | NP if you get stuck come back | 14:08.23 |
| You could also check Stack Overflow I may have an answer or two there which might help | 14:08.52 |
JoshG | This ended up working. Thanks for the help "<< /CurrPageNum 1 def /Install { /CurrPageNum CurrPageNum 1 add def CurrPageNum 2 mod 1 eq {13 -10 translate} {0 -10 translate} ifelse } bind >> setpagedevice" | 15:13.39 |
kens | JoshG glad it worked congrats on your PostScript skillz :-) | 15:15.12 |
JoshG | I have done work in a lot of languages but postscript sure is different | 15:16.41 |
andyrtr | hi all. how will you deal with CVE-2019-6116 - the mentioned patches don't apply cleanly to 9.26 release. Debian announces 9.26a as new upstream release that's can't find at your pages. | 17:10.38 |
chrisl | andyrtr: You can get a patch against 9.26 here: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/tag/gs926 | 17:12.47 |
andyrtr | thanks, found it. | 17:14.29 |
sebras | chrisl: thanks. | 17:50.53 |
taviso | chrisl: thanks again for all the work on the update, that was a tough one. | 22:10.09 |
| Forward 1 day (to 2019/01/25)>>> | |