| <<<Back 1 day (to 2015/04/29) | 20150430 |
rayjj | michaelrose: AFAIK, the 'mupdf' app for windows/x11/macosx doesn't have this. Since all of our source is open, you are welcome to adapt the code from the android app (I assume it does this, since you are asking) and build a modified app that includes this. If you do, we would probably be interested in working with you to adopt the enhancement. | 00:03.23 |
Robin_Watts | rayjj: You are right. | 00:21.11 |
| rayjj: Mutool has an option to dump the outlines (what you call the table of contents) | 00:21.42 |
| so you can see there that it's possible on the desktop. | 00:21.52 |
michaelrose | thanks i will just keep using zathura | 00:46.13 |
marcosw | Robin_Watts: what are you doing up? | 00:46.27 |
sebras | Robin_Watts: I think there's a key for this in the sample opengl-based viewer too. (has it been merged to master?) | 00:46.28 |
sebras | heads to bed. | 00:46.48 |
michaelrose | zathura actually has a mupdf backed so there is that | 00:48.49 |
| regarding the android app it is atm quite frankly terrible, but super fast | 00:51.32 |
| the biggest thing is that text that is reflowed is screwy so that feature doesn't really work and its really essential to using it on any device smaller than a 10" tablet | 00:52.53 |
| its actually acceptable on pdfs in non reflowed viewed in landscape | 00:54.47 |
| also when you have it zoomed in and go to the next page the transition where you kind of go up and sideways to get to the top of the next page is super jarring | 01:00.12 |
| it is far less so if it appears the next page is reached by scrolling down since that is how you scroll through the page itself | 01:00.59 |
| also buttons that don't look like they are created by a 12 year old with clipart would be awesome too | 01:01.42 |
| also could use some way to open recently viewed books in the app | 01:03.48 |
mvrhel_laptop | argh. I swear I keep finding little issues in gsview | 06:02.44 |
| luckily most are simple to fix | 06:17.13 |
ManDay | Hi, I've found a trick how to crop a document with gs on SE and it works all right: gs -o "$outfile" -dFirstPage=$testpage -dLastPage=$testpage -sDEVICE=pdfwrite -c "[/CropBox [$max_left $max_bottom $min_right $min_top]" -c " /PAGES pdfmark" -f "$infile" | 07:02.40 |
| It has worked alright for many documents. | 07:02.55 |
kens | All you ar doing is adding a CropBox, the contnet is still present | 07:03.07 |
ManDay | But now I've got a PDF for which it appears to be ignored. | 07:03.12 |
| yeah kens I understand | 07:03.17 |
kens | I'm fairly certain I've posted that on STack Overflow before | 07:03.22 |
ManDay | yeah, that's where i found it | 07:03.35 |
| oh i said SE | 07:03.41 |
| i mean stack overflow | 07:03.44 |
| do you have any idea why it's ignored for one pdf? | 07:03.55 |
kens | Probably that PDF already has a CropBox, and since you aren't sending the pdfmark after the input file, it overrides the one you set before the input file. | 07:04.47 |
| Move the PostScript to after the input file and it might work | 07:05.01 |
ManDay | oh, i didn't realize the order of arguments matters | 07:05.13 |
| lemme try | 07:05.15 |
kens | The PostScript is, in effect, another intput file, you would reasonably expect the order in which the input files are procesed to be relevant :-) | 07:05.49 |
ManDay | hehe, i figured. now it even matters whether -o or -i comes first and where I put the -dFirstPage | 07:07.24 |
| weird | 07:07.28 |
kens | The documentation does say that the argument order matters (somewhere). It mostly matters where the arguments go relating to the input. If you consider anythign in -c...-f to be an input file it should make sense | 07:08.13 |
ManDay | I tried -f ... -c ... now but it still appears to be ignored | 07:08.47 |
kens | The Switches themselves set PostScript variables, which is why it alters if you stick them between input files, they are set for files *after* the switch is set, but not before | 07:08.55 |
| ThenI'd have to see the PDF fikle to comment | 07:09.08 |
ManDay | http://home.basu.ac.ir/~psu/Books/%5BMehran_Kardar%5D_Statistical_Physics_of_Particles%28BookFi.org%29.pdf | 07:09.24 |
kens | Is ths going to be some huge hundreds of pages file ? | 07:09.47 |
ManDay | yes. but I'm running it with -dFirstPage=24 and -dLastPage=24 | 07:10.54 |
| Oh, is there a problem as in you'd have to read the source? | 07:11.10 |
kens | I'll look at it later, I'm doing morning stuff at the moment | 07:11.13 |
ManDay | all right | 07:11.18 |
| I'll try around a bit more, perhaps I can find something | 07:11.31 |
kens | A command line would be useful too (cos for instance you didn't mention you were only looking at page 24) | 07:11.55 |
ManDay | sure | 07:12.26 |
| gs -o "/tmp/tmp.7jcJjYeQpb" -dFirstPage=24 -dLastPage=24 -sDEVICE=pdfwrite -f "[Mehran_Kardar]_Statistical_Physics_of_Particles(BookFi.org).pdf" -c "[/CropBox [0 0 235 306]" -c " /PAGES pdfmark" | 07:14.12 |
kens | That pdfmark looks wrong | 07:14.32 |
| You've used -c twice and left -f back in its previous position | 07:14.51 |
| and there shouldn't be a " -c between parts of the pdfmark operands like that | 07:15.23 |
| It 'might' not cause somplaints, because it introduces new PostScript, but it isn't right | 07:16.33 |
ManDay | I've taken that code from here, basically http://stackoverflow.com/questions/6183479/cropping-a-pdf-using-ghostscript-9-01 | 07:16.51 |
| Originally, it was -c ... -c ... -f ... and didn't work. Now it's -f ... -c ... -c ... | 07:17.15 |
| I thought moving the -f forward is what I should do | 07:17.25 |
kens | No, ths is document.... | 07:17.41 |
| -c means 'treat the following as PostScript' and -f means 'stop doing that' | 07:18.01 |
| You cna get away with -c ... -c because the second one is redundant | 07:18.18 |
| And you can get away with leaving -f around because unless you are already processing input as PostScript , its a no-op | 07:19.20 |
| But its best to get it right | 07:19.31 |
| The command line in that SO answer (which isn't one of mine) is techncially incorrect | 07:20.03 |
ManDay | so gs -o ... input.pdf -c .... should work but it doesnt? | 07:20.36 |
kens | Should work, but I haven't tried it. | 07:20.51 |
ManDay | I ran | 07:22.40 |
| gs -o "/tmp/tmp.7jcJjYeQpb" -dFirstPage=24 -dLastPage=24 -sDEVICE=pdfwrite "[Mehran_Kardar]_Statistical_Physics_of_Particles(BookFi.org).pdf" -c "[/CropBox [0 0 235 106] /PAGES pdfmark" | 07:22.53 |
kens | Ah, I see the problem. | 07:23.15 |
| You are using a /PAGES pdfmark whch has to come before any page is run | 07:23.27 |
| Because it is intended to affect *all* pages | 07:23.40 |
ManDay | so now it should be -c "/PGAES pdfmark" -f ... -c"[/CropBox ...]" ? | 07:24.14 |
kens | Running it after the fact has no effect. the PAGE pdfmark has already been set | 07:24.16 |
| Best way to deal with ths, I thnk is to use an EndPage procedure | 07:24.31 |
| Try ths answer: | 07:25.49 |
| http://stackoverflow.com/questions/26985557/how-do-i-resize-a-pdf-to-be-exactly-8-5-x-11-inches-using-ghostscript/26989410#26989410 | 07:25.49 |
ManDay | i dont understand. it worked well with all other pdfs. what's wrong with this one? | 07:25.54 |
| ok | 07:25.57 |
kens | Note that you only want the EndPage procedure, not the rest of the command line | 07:27.34 |
ManDay | yeah, i think i understand it somewhat now | 07:28.14 |
| the problem is that this document has a cropbox on each page | 07:28.21 |
kens | That's the provlem in that file, I suspect yours maybe the same | 07:28.36 |
ManDay | well, the first page has a different size in my viewer | 07:28.50 |
kens | I haven't had a chance to look yet | 07:28.50 |
ManDay | so i suspect that's it | 07:28.54 |
kens | That could just as easily be a MediaBox difference | 07:29.15 |
ManDay | that answer has the file come after the code | 07:31.39 |
kens | Yes, because its a different approach | 07:31.53 |
| You will want to do that | 07:32.07 |
ManDay | will this then work for all documents or will i have to distinguih between those which worked so far and the ones which didn't work (this is actually part of a script which prepares documents for my ereader, so I would like to have this work generically) | 07:33.03 |
| or better: | 07:33.16 |
| could you point out where that language with the << >> etc is documented? | 07:33.29 |
| perhaps i could understand it myself then | 07:33.35 |
kens | That code should work on all files, creating a file where every page has a /CropBox. | 07:33.37 |
ManDay | Wouldn't it be better if the whole document had a single cropbox? | 07:34.19 |
kens | The language is PostScript, a Google will find you the PostScript Language Reference Manual, but it will take you some time to learn it, its a little different. Oh, and the << >> are part of the language | 07:34.25 |
chrisl | ManDay: you can learn all about Postscript from this: https://www.adobe.com/products/postscript/pdfs/PLRM.pdf | 07:35.13 |
| But as kens says, it's a bit "different" | 07:35.28 |
ManDay | heh | 07:36.02 |
| would it be an easy thing to make the document have a single cropbox? | 07:37.03 |
kens | No | 07:37.09 |
ManDay | Thought I could just remove cropboxes :-/ | 07:37.31 |
kens | You owuld have to modify the PDF interpreter to do so | 07:37.32 |
ManDay | Oh, I thought my previous script did that already and only in this case it wouldnt work | 07:38.19 |
kens | No, you were adding (replacing) a CropBox there | 07:38.40 |
ManDay | Why did it not work with the other document then? I thought your first approach meant to replace an existing cropbox | 07:40.06 |
kens | To be honest, I don't have the time for a lengthy explanation of the waqy that the pdfwrite device and the PDF interpreter work right now. If you really want a detailed technical discussion, come back in a couple of hours after I've done my mornign chores and had my first morning coffee, and had time to look at your file and I'll be better able to answer | 07:41.33 |
ManDay | thanks. sorry i did not mean to be annoying | 07:42.18 |
| im just happy it works now. thanks | 07:42.26 |
kens | SO it does work ? That's good to know | 07:42.40 |
ManDay | oh | 07:43.10 |
| kinda. i think. | 07:43.23 |
| at least it does have an effect. i think the calculations are now off because it already had a cropbox before and pdfinfo -box didn't return the right value | 07:43.51 |
kens | You cannot rely on pdfinfo, I believe, as it will give you the intersetctoin of the boxes. If you really want to know what's in a PDF file you will have to look inside it | 07:44.28 |
| Much the same as the SO user who thought he could figure out if a PDF file was gray by using the inkcov device | 07:44.58 |
chrisl | I think DumpMediaSizes with pdfinfo will give the actual *Box values..... | 07:46.08 |
ManDay | According to pdfinfo the *Box'es are all the same. If however, I rewrite the PDF with the same Cropbox that is described by pdfinfo, i get only a chunk of the content | 07:46.25 |
kens | chrisl that's our pdfino.ps, pdfinfo seems to be something else | 07:46.41 |
chrisl | Oh, <shrug> then..... | 07:46.54 |
| Possibly use ours, then?!? | 07:47.42 |
ManDay | chrisl: where can I find it? | 07:49.41 |
kens | ghostpdl/gs/toolbin | 07:52.59 |
ManDay | thanks | 07:53.37 |
| i dont think less deserves the name pager. it just tried to open the ps file somehow instead of just showing its contents | 07:55.34 |
| chrisl: When I try to run it as described I get an Error "/undefinedfilename in (toolbin/pdf_info.ps)" | 07:57.30 |
| (I ran gs -dNODISPLAY -q -sFile=Kardard-Orig.pfg -dDumpMediaSizes toolbin/pdf_info.ps as described in the file) | 07:57.51 |
| (Same after I converted it to PS with pdf2ps) | 08:00.27 |
| oh... | 08:00.49 |
| sorry, I noticed... | 08:01.01 |
| Yeah that works and give completely different numbers from that of pdfinfo | 08:01.30 |
chrisl | ManDay: I don't understand the comment about "less"...... | 08:04.38 |
ManDay | chrisl: /usr/bin/less file.ps will not show the contents of file.ps | 08:05.31 |
| that's all i meant | 08:05.34 |
| (At least not on gentoo) | 08:05.49 |
chrisl | It shows the bare Postscript, it's not a PS interpreter | 08:06.26 |
ManDay | not for me. for me it tries to automatically parse it | 08:07.10 |
chrisl | Really?!?! That's, um, bad..... | 08:07.43 |
| Sounds like a bug, tbh | 08:08.27 |
| Oh, less does something similar with PDF for me - ick :-( | 08:10.33 |
| ManDay: maybe instead, do: cat file.ps | less | 08:11.33 |
ManDay | yeah, i did that | 08:12.53 |
chrisl | Cool. That's how I normally use less anyway (old skool!) - but I think it's really awful that it's trying to parse the file. I bet it doesn't try to compile C code, nor run a shell script! | 08:14.14 |
ManDay | well, it unpacks .bz2 and .tar files... | 08:16.09 |
| (less /usr/share/doc//rpm2targz-9.0.0.5g/rpm2targz.README.bz2) | 08:16.21 |
chrisl | Again, I think that's very bad..... | 08:16.30 |
ManDay | hehe, yeah, i agree | 08:16.35 |
chrisl | I think I'll tweak pdf_info.ps to accept FirstPage/LastPage options...... | 08:21.57 |
kens | If you want to play with it, you could have it apply some sensse about double parsing the file | 08:22.35 |
chrisl | Yeh, but that might be hard, whereas FirstPage/LastPage is easy ;-) | 08:23.13 |
kens | It shouldn't be enormously hard to loop over the file once and apply all the relevant options, and you'll be playing with the loop code anyway | 08:23.40 |
| At the moment I thnk you might have to apply your changes in 2 places, because there are two places where it loops round hte pages | 08:24.08 |
| But ths is all from (fading) memory | 08:24.23 |
chrisl | Yeh, I'll poke at it when I get back from squash training, in a couple of hours | 08:24.33 |
kens | 'enjoy' :-) | 08:24.43 |
chrisl | Hmm, thanks.... | 08:25.25 |
ManDay | Now I need different cropboxes on different pages :-/ | 08:42.09 |
| hm, the spec is only 900 pages, that's not so bad | 08:44.26 |
| Can anyone explain what "... {0 eq ...}" does? I thought eq takes two operands? | 08:50.10 |
| he kens | 08:52.34 |
| can you explain why in your code {0 eq... eq has only one operand (0)? | 08:52.55 |
kens | The other one is passed in by the interpreer | 08:53.09 |
ManDay | being what? | 08:53.37 |
| I'm reading through the list of ops in the spec to try to build a way to give different cropboxes for odd and even pages | 08:53.58 |
kens | A 'reason' code, you'll need to read teh PLRM on EndPage procedures to find out what it all means | 08:53.59 |
ManDay | ok | 08:54.08 |
kens | You won't want to change that test | 08:54.35 |
ManDay | no, i figured that | 08:54.44 |
| but I want to nest another ifelse into it | 08:54.50 |
kens | Feasible, just make sure you test the reason code first :-) | 08:55.13 |
ManDay | yeah, i found the section | 08:55.24 |
| so the op takes the missing operand fro mthe stack | 08:55.35 |
kens | All operands are fetched from the stack | 08:55.50 |
ManDay | yeah, i see. it's like RPL (reverse polish) | 08:56.10 |
kens | Indeed it is reverse polish logic, because of the stack | 08:56.26 |
ManDay | kens: just why is it {... {...}{false}ifelse} rather than just {... {...}if} ? | 09:00.03 |
| does the false have any significance? | 09:00.10 |
kens | Well its putting a boolean for a following operatoin | 09:00.23 |
ManDay | i think the boolean or whatever coems from the if goes into the dict, right? | 09:00.55 |
kens | Presumably there is a test in the bit you elided which also returns a boolean | 09:00.57 |
ManDay | oh yeah | 09:01.07 |
kens | So a boolean ends up on the stack and the next piece of code presumably uses it | 09:01.25 |
ManDay | i guess that's what setpagedevice requires in the dict then | 09:01.27 |
kens | No. | 09:01.37 |
ManDay | :-| | 09:01.42 |
kens | I suspect you are looking at the return code from teh EndPage procedure | 09:01.51 |
| THe procedure returns a code whcih determines whether the page is emitted or not | 09:02.04 |
ManDay | ah ok, i didn't get to the /-syntax yet. | 09:02.30 |
kens | "/" introduces a name object | 09:02.50 |
| Dictionaries take pairs of objects a key and a value. Keys are usually (but not required to be) names | 09:03.22 |
ManDay | ah now i get it | 09:04.17 |
| it defines a dictionary the first value is the name "EndPage" and the second is the procedure which setpagedevice expects there | 09:04.56 |
kens | Yes | 09:05.06 |
ManDay | so it will then "register" an endpage procedure | 09:05.08 |
kens | Yes, whenever we reach the end of a page, the interpreter executes any EndPage in tehpage device dict | 09:05.26 |
ManDay | just so i understand this: Is code then executed kind of "compile time" or will it embed in the PS file so that it's executed every time I'm trying to view the PDF? | 09:05.40 |
| (since I'm planning to read the PDF on a low-on-resources device, I'd have to make sure I write well optimized in case its the latter) | 09:06.24 |
kens | You don't put PostScript in PDF files | 09:06.33 |
ManDay | oh ok | 09:06.53 |
kens | As I said, teh EndPage procedure is executed by the ostScript interpreter when it reaches the end of a page (showpage, copypage etc) | 09:07.02 |
Stijn_ | hi, can I ask about an issue with gs here? | 09:07.32 |
ManDay | i wasn't sure whether "postscript" interpreter is also the thing that is used when the PDF is rendered. but now i understand. the postscript interpreter will render a PDF file | 09:07.38 |
kens | You can ask.... | 09:07.39 |
Stijn_ | I've got this PDF here, and it wants to draw an image faded in the background, but gswin64 shows the page with the logo at full opacity... | 09:08.53 |
| I've trying to figure out why, the code calls a form that draws the image, but I'm not sure how the 'translucency' (or what's it called) is done, could it be with a /Decode [] on the /Image? | 09:10.09 |
kens | ManDay Ghostscript is a PostScript interpreter, the PDF interpreter for Ghostscript is written in PostScript. This has many disadvantages. However it has one great advantage, we can use PostScript as, in effect, a scritping language | 09:10.16 |
| Stijn_ : I would need to see the file to comment. | 09:10.38 |
| Also the command line you are using, and the version of Ghostscript | 09:10.48 |
| If you thnk GS is incorrect you could open a bug report | 09:10.57 |
Stijn_ | http://proflab.spector.be/temp/1234.pdf | 09:11.04 |
| I guess I should open a bug report, but this PDF is 'sensitive' as it contains data from the customer I shouldn't disclose | 09:11.44 |
kens | Crumbs, you shouldn't have posted a link to it here then, ths channel is logged. Please move it asap | 09:12.06 |
| If you open a report I cna make the attachement private, then only Artifeex employees can see it. | 09:12.32 |
Stijn_ | I want to make a new PDF that just minimally makes this opacity thing go wrong, but am not sure what is causing it | 09:13.16 |
kens | Transparency in PDF is hard, it might be very difficult to reproduce in a different file. | 09:13.42 |
Stijn_ | could it be /Decode on /Image? | 09:13.59 |
kens | No | 09:14.06 |
| It'll be the transparency | 09:14.13 |
Robin_Watts | MuPDF gets it right. | 09:14.17 |
kens | So does Acrobat, and even node.js | 09:14.26 |
Robin_Watts | pdf.js :) | 09:14.37 |
kens | Its clearly incorrect, and its obviously one for Michael | 09:14.42 |
| Yes sorry pdf.js | 09:14.46 |
Stijn_ | this is the bit with the Do in it, where's the transparency? q 71.46999 253.82 m 265.82 253.82 l 265.82 80.92001 l 71.46999 80.92001 l h W n 71.46999 80.92001 194.35 172.9 re W n /Perceptual ri q 194.35 0 0 172.9 71.46999 80.92001 cm /Im2 Do Q | 09:15.28 |
kens | The trasnparency will be elsewhere | 09:15.55 |
| Probably in the Form | 09:16.01 |
Stijn_ | could it be an /SMask? | 09:16.16 |
kens | SMask is transparency | 09:16.23 |
| I cna reduce it to just the background logo | 09:16.51 |
| THe coat of arms | 09:17.02 |
Stijn_ | ok, that's what I was looking for, I guess I should be able to manifacture a minimally repoducing pdf with this | 09:17.14 |
| and then file it with the bug report | 09:17.29 |
kens | Give me a minute and you cna have ths one | 09:17.30 |
Stijn_ | you mean get the text out and replace the logo with something generic? | 09:17.51 |
kens | I can remove everything except the coat of arms, is that not sufficient ? | 09:18.16 |
Stijn_ | please replace the image itself with something non-privacy-sensitive like a GS logo | 09:18.39 |
kens | I don't thnk I cna do that, no. | 09:18.47 |
| There's 26 Mb of mostly image data there it seems | 09:19.00 |
Stijn_ | but I can replace the bitmap, so if you remove the text it would be a great help | 09:19.45 |
| (then again, I probably could just drop anything but the /Im2 DO | 09:20.26 |
kens | Not so simple, your form calls another form | 09:20.29 |
| The second form also contains text, possibly some text in the coat of arms | 09:21.14 |
| There is no SMask in the file now, and no transparency I can see, interesting. | 09:22.22 |
| I wonder if its somehow interpolation | 09:23.14 |
Stijn_ | anyway, I've got what I need to know, I'll rip anything unrelated from the file, replace the bitmap and get a 'generic' pdf to reproduce the bug with so I can file a bug... | 09:24.17 |
kens | Yes, its caused by the image havoing interpolation turned on, If you run it with -dNOINTERPOLATE hte problem goes away | 09:24.22 |
| So it looks like a colour management problem to me, still Michael's area, but a different issue. | 09:25.08 |
Stijn_ | oh, so is this still a bug? | 09:25.11 |
kens | Its some kind of bug, no idea what exactly | 09:25.24 |
| The image is using an ICCBased colour profile, and I'd have to guess that the interpolation is screwing with the colour management, but thats' purely guesswork. | 09:25.58 |
| It defintely *isn't* transparency related though | 09:26.12 |
| My guess is that MuPDF is correct because its ignoring the ICC profile, and using DeviceRGB instead. And possibly ignoring interpolation too. | 09:26.54 |
| Anyway, if you cna make a file which causes the problem, please do open a bug report. All I can tell you is that you will need an image in a particular ICCBased colour space, and it has to have Interpolation enabled. | 09:28.06 |
| If you know how the coat of arms was created, perhaps you can reproduce it. Otherwise you can attach the file and let someone know here and they can make it private. | 09:28.51 |
| Best to check someone here is awake and listening before you open the report, then they'll be able to mark it private quickly | 09:29.15 |
tor8 | kens: we (should) respect the Interpolate flag when drawing images in MuPDF | 09:29.18 |
| but we do ignore the ICC profile | 09:29.28 |
kens | tor8 I'm only guessing, honest | 09:29.28 |
| Clearly GS shouldn't be getting the colours muddled up when it has interpolation true either | 09:29.49 |
tor8 | kens: I would've guessed the same if I hadn't actually remembered adding Interpolate :) | 09:29.51 |
Stijn_ | also, I was thinking, since it's for a sign with opening hours... it's probably only officially privacy-sensitive... | 09:29.54 |
kens | Stijn_ : If you're happy to leave the logo intact I can send you the PDF file with just that, all other objects removed. | 09:30.24 |
Stijn_ | and I guess I could probably chance it of that organisation coming across a copy of their opening sign between the ghostscript bugs... | 09:30.38 |
kens | Give me a second, I'll post the modified file on Dropbox | 09:31.17 |
Stijn_ | I think that private option is the way to go. I'll post the bug now | 09:31.43 |
kens | Oh OK then I'll mark it as private straight away | 09:31.57 |
| In fact, if you just open the report I'll add the reduced attachement | 09:32.24 |
| THat way I cna make it private right then. | 09:32.32 |
kens | wonders what he was supposed to be doing ths morning..... | 09:33.00 |
Stijn_ | is that for the PS or PDF interpreter? | 09:33.04 |
kens | PDF | 09:33.08 |
| But make it colour | 09:33.15 |
| I cna change it afterwads if needed | 09:33.27 |
Stijn_ | http://bugs.ghostscript.com/show_bug.cgi?id=695973 | 09:35.47 |
| I see you've got the email also | 09:36.16 |
kens | Yes, give me a second | 09:36.25 |
| Well the attachement is on its way but 5Mb will take a minute or two to upload | 09:37.14 |
| Mayeb longer since Bugzilla doesn't seem to be talkign to me | 09:37.31 |
| OK both attachments marked private | 09:38.15 |
| OK so you should be able to see that the attachments are private, and I've added a few details to the report | 09:39.57 |
| You'll get mail when anythign changes about its status, if that's annoying I thnkyou cna remove yourself from the CC list. | 09:40.25 |
| And that assigns it to Michael who may actually be able to fix it. Thanks for the report! | 09:41.42 |
Stijn_ | Should I change the title to 'image not drawing transparently'? | 09:41.48 |
kens | Its OK I changed that too | 09:41.55 |
Stijn_ | ok, tanks for all the great work | 09:42.04 |
kens | You'll get a flurry of emails in a minute | 09:42.06 |
Stijn_ | goes whoohoo | 09:42.25 |
ManDay | kens: heh, pdfmark has a whole documentation on its own | 11:02.00 |
kens | yes it does | 11:02.15 |
ManDay | is gs all right with line breaks in the -c argument? | 11:05.00 |
kens | Don;t know, use @args syntax to put it in a file if in doubt | 11:05.15 |
ManDay | aye | 11:05.32 |
| kens could you tell me which operator provides the current page number? | 11:07.21 |
kens | There isn't one | 11:07.48 |
ManDay | goddamit? | 11:08.09 |
Robin_Watts | chrisl: ping ? | 11:08.30 |
kens | One of the args to EndPage is the current count of pages emitted | 11:08.33 |
chrisl | Robin_Watts: pong | 11:08.35 |
Robin_Watts | chrisl: You'd said a while ago you were considering a Lenovo lappy. | 11:08.52 |
| I'm being very tempted by a T450s. | 11:09.03 |
| Which one was taking your fancy? | 11:09.10 |
ManDay | kens: ah, good enought! | 11:09.27 |
chrisl | Robin_Watts: I bought it a few weeks ago - Thinkpad x250 | 11:09.31 |
Robin_Watts | chrisl: Interesting. A smidge smaller than the T450s, but not by much. | 11:15.03 |
| Happy with it? | 11:15.20 |
| which screen did you go for? | 11:15.58 |
chrisl | So far, yes. The twin batteries was what swung it for me..... | 11:16.02 |
| I went for the high-res screen | 11:16.13 |
Robin_Watts | chrisl: Yeah, the T450s has the same battery options. | 11:16.15 |
| 1920x1080 ? | 11:16.19 |
chrisl | Er, I think so.... | 11:16.37 |
Robin_Watts | That's full HD (and it's what I am looking at). | 11:17.17 |
| The DELL 13incher has 4 times that resolution in the same space. I just can't conceive of having eyes good enough to use it. | 11:17.47 |
chrisl | That 1920x1080 is about as high as I would want to go on a screen that size | 11:18.26 |
| Robin_Watts: I think the choice depends on the primary intended use - I went for the x250 as the smallest (within reason) I could get, because it will be better for the plane | 11:22.04 |
ManDay | I would like to write different cropboxes to each page (during EndPage) depending on the page number. Each page number is converted to an index for four dictioniaries, echo containing left, bottom, right, and top edges respectively. | 11:23.53 |
| So the pagenumber is on the stack when the endpage procedure is called. now I need to push [/CropBox and then push the correct index from four dictionaries | 11:24.54 |
| Do I need to swap around on the stack so that I can refer to the pagenumber while [/CropBox is already on the stack? | 11:25.21 |
| or is there an easier solution? | 11:25.36 |
Robin_Watts | chrisl: The T450s is the same size as my current macbook. | 11:25.39 |
chrisl | Robin_Watts: but it's bigger than the previous Lenovo I was using..... whilst the x250 is slightly wider, but actually less deep | 11:26.33 |
Robin_Watts | chrisl: Yeah, yours is an inch less wide, and fractionally less deep. | 11:27.16 |
| (oh err, missus) | 11:27.21 |
chrisl | For travelling, size definitely matters...... | 11:27.57 |
Robin_Watts | I find the macbook quite usable. I wouldn't want to go any larger though | 11:28.36 |
ManDay | Does anyone understand my question? | 11:29.10 |
chrisl | ManDay: look up the index operator | 11:29.27 |
ManDay | ah | 11:29.35 |
| that's an easy one | 11:29.41 |
| I don't think RPL has that | 11:29.46 |
| but they have a notion of local vars | 11:29.53 |
| thanks chrisl | 11:30.06 |
chrisl | You could create a transient dictionary for "local" variables, if required | 11:30.37 |
oblo | hi all! i have installed ghostscript and finally my print is printing! but i think is using ghostscript fonts and i would use microsoft fonts.. how to do it? | 11:32.28 |
chrisl | oblo: that depends on what's in the print job, and what platform you're on | 11:33.55 |
oblo | i'm on linux.. in general i copy "WindowsFonts" in /usr/share/fonts/ and i do # fc-cache | 11:34.54 |
chrisl | The if the job uses standard Postscript/PDF fonts, we'll use the Ghostscript ones because they are "standard"..... | 11:36.10 |
| s/The/Then | 11:36.17 |
oblo | or i need to copy my fonts in /usr/share/ghostscript/fonts/ and fc-cache -v /usr/share/ghostscript/fonts/ | 11:41.18 |
| i have to try | 11:41.25 |
chrisl | oblo: Ghostscript would normally be using fontconfig to try to find non-standard fonts, so the location isn't terribly important | 11:42.07 |
oblo | ah | 11:42.19 |
ManDay | What's wrong in l 128 ? | 11:42.30 |
| http://dpaste.com/04435PZ | 11:42.32 |
oblo | thx chrils :O) | 11:42.46 |
ManDay | oh sorry | 11:42.58 |
| wrong channel | 11:43.00 |
chrisl | oblo: if Ghostscript *isn't* finding non-standard fonts in the way you want, you could try adding "-sFONTPATH=/usr/share/fonts/WindowsFonts" (or whatever) to your command line | 11:44.22 |
oblo | uhm i can try | 11:45.18 |
chrisl | oblo: finally, if you *really* want to replace the standard fonts, you then need to write your own Fontmap file..... | 11:47.55 |
oblo | i think in my firts build i didn't installed fonts and my print is using system fonts correctly, now i did this step but onestly is not a big problem | 11:53.22 |
chrisl | Did you build gs directly from source (i.e. not using a package manager)? | 11:55.04 |
oblo | yes i'm using lfs.. but i'm not a big expert | 11:56.10 |
chrisl | lfs?? | 11:56.21 |
oblo | and in effect in lfs 7.6 my print is using microsoft fonts and i skipped the font step in ghostscript | 11:56.45 |
| sorry for my terrible english! | 11:57.51 |
chrisl | I don't know how lfs works - the Ghostcript build will not use fontconfig if it doesn't find the libraries it can link to | 11:58.09 |
oblo | this time i did.. just a moment | 11:58.32 |
| tar -xvf ../<font-tarball> -C /usr/share/ghostscript --no-same-owner && | 11:58.47 |
| fc-cache -v /usr/share/ghostscript/fonts/ | 11:58.47 |
| and i think this is the "problem" | 11:58.58 |
ManDay | Can anyone help me with cryptic error messages? | 12:03.14 |
| Do you see a issue in this code? http://dpaste.com/275AZSZ | 12:03.31 |
kens | You have the index and irts parameter reversed in every case | 12:03.59 |
ManDay | ouu | 12:04.21 |
| yea | 12:04.22 |
| ty | 12:04.28 |
| Hm. I still get the "/undefined in --.endpage--" | 12:05.44 |
kens | Put (step 1) == flush in at intervals, that will tell you where hte error occurs | 12:06.15 |
| Old school debugging is all thre is i PostScript | 12:06.31 |
ManDay | http://dpaste.com/1Y1PKA0 | 12:07.03 |
| ok, i will try this | 12:07.17 |
chrisl | ManDay: "CropBox" probably should be "/CropBox" | 12:07.52 |
ManDay | chrisl: That did it! | 12:08.40 |
kens | Its almost impossible to debug a PostScript program wihtout comments or some idea what you are trying to achieve. I don't know what you thnk 'get'; is doing, but I don';t think it is doing what you expect. And you are going to end up with an awful lot of arrays on teh stack at the end of ths | 12:08.43 |
ManDay | Now I have a "/typecheck" error :-D | 12:09.07 |
| kens: Oh, the way you say that makes me think you're right | 12:09.26 |
kens | Which tells you that you executed an operator and one of the operands had the wrong type. | 12:09.27 |
ManDay | I thought get consumes an array and an index from the stack and leaves the element back | 12:09.38 |
| hm.. | 12:10.11 |
chrisl | I'm guessing that in the "real" code, the arrays are generated from the input..... | 12:10.24 |
kens | It does, but I'm not convinced you have an index there | 12:10.25 |
ManDay | i'm not convised i have correctly understood the order of operands | 12:10.56 |
| if the docs say array index GET any - that would mean "index" is the last element pushed onto the stack, right? | 12:11.18 |
kens | The order 'looks' OK | 12:11.21 |
| Yes | 12:11.26 |
| You can use pstack to print the stack | 12:11.43 |
ManDay | cool, will do that | 12:11.48 |
kens | You can also type PostScript at the GS> prompt, and you could tunr your EndPage into a simple PostScript program and debug it immediately without involving setpagedevice | 12:12.35 |
| Ah, andyou haven't got the index correct :-) | 12:14.59 |
| You do a 2 mod, that gives you either 0 or 1 depending on the count of pages | 12:15.17 |
| Then you do [ | 12:15.28 |
| which introduces a mark onto the stack | 12:15.34 |
| So now there are two objects on the stack | 12:15.44 |
ManDay | yes? | 12:15.57 |
| here is what I think I'm doing: | 12:16.04 |
kens | THen you do /CropBox, so now your stack has 0/1 [ /CropBox | 12:16.06 |
| Then you put another array on the stack containing [0 0] | 12:16.21 |
| Now you have 4 objects on the stacK, eg: | 12:16.31 |
| 0 [ /CropBox array | 12:16.48 |
| Then you do 2 index | 12:16.52 |
ManDay | oh | 12:17.01 |
kens | ) index would get you the array, 1 index would get you the /CropBox, 2 index gets you the mark | 12:17.09 |
ManDay | i didn't realize the [ was an own object | 12:17.10 |
kens | Its in the PLRM :-) | 12:17.24 |
| [ and ] are operators | 12:17.44 |
| [ puts a mark object on the stack, ] consumes the stack up to the last mark and puts the elements into an array | 12:18.08 |
ManDay | yeah, i see it now in the pdfmark spec aswell | 12:18.10 |
kens | Then pushes that array onto the stack | 12:18.15 |
ManDay | i was just confused because there was no closing mark | 12:18.18 |
| i thought that "[" in that case was a pdfmark internal which simply check wether an object begins with a "[" | 12:18.35 |
kens | pdfmark does the same as ']' and addtionally makes it into t aPDF 'thing' | 12:18.42 |
| No, [ is a mark, in PostScript it can't be anything else, and pdfmark syntax has to be valid PostScript | 12:19.08 |
ManDay | it worked! \o/ | 12:19.11 |
kens | Note that pdfmark won't work in normal Postcript interpreters, its a PDF-specific extension to the language | 12:20.26 |
ManDay | yeah but gs does it :) | 12:20.45 |
kens | It does, but only if the output device is pdfwrite | 12:20.58 |
ManDay | sure but otherwise cropbox wouldnt make sense anyway, would it | 12:22.29 |
kens | No, that's why it doesn't work (and will throw an error) if you try to use it with a device other than pdfwrite | 12:22.56 |
| You just need to be aware this isn't something 'universal' you can use with Ghostscript, its only vlaid for pdfwrite | 12:23.28 |
ManDay | hm. so i don't get any more errors but it doesn't crop the pdf either :-/ | 12:23.33 |
kens | Then you're back to debugging | 12:23.46 |
ManDay | was it (step 2) == flush (tmux crashed, i lost that)? | 12:24.10 |
kens | Put a pstack immediatley before pdfmark and you can see what;s on the stack just before you try to set it. | 12:24.11 |
ManDay | What do the ( ) do? | 12:24.16 |
| all right | 12:24.22 |
kens | () are string delimiters | 12:24.24 |
ManDay | heh | 12:24.54 |
kens | == prints certain kinds of objects (in particular strings) to stdout | 12:24.55 |
ManDay | so... i wanted to put a pstack before the pdfmark | 12:25.07 |
kens | Yes | 12:25.13 |
ManDay | turns out i couldnt. | 12:25.14 |
| there is no pdfmark :-D | 12:25.21 |
kens | Then your problem is solved.... | 12:25.30 |
ManDay | ^^ | 12:25.33 |
| kens: I've lost the link you gave me and I don't remember what has to immediately preceede pdfmark. Was it /PAGES like in my original code? | 12:32.02 |
kens | Check the irc logs | 12:32.21 |
ManDay | good | 12:33.02 |
| Here, it's done :) http://dpaste.com/2210K8S | 13:02.25 |
kens | Well I don't read bash, but OK as long as you're happy with it :-) | 13:03.50 |
ManDay | it even has a usage description and uses getopts :-P | 13:04.09 |
| It crops pdfs to a minimum area keeping an optimal ratio (like DIN A4) | 13:04.28 |
| if you have an ereader you may appreciate it | 13:05.39 |
kens | Nope, no e-book reader. Tor8 has many though :-) | 13:05.58 |
ManDay | i programmed it fully generally. if they ever start publishing books where not just the odd and even pages differ in alignment, it can handle that! :-D | 13:06.12 |
| like every 3rd page or so | 13:06.18 |
| (dunno what such a book would look like, but it's best to keep it general, a'ight?) | 13:06.33 |
| tor8: well, if you like :P | 13:06.43 |
kens | suspets Tor has his own arcane ritual for hacking PDF files | 13:07.09 |
ManDay | not anymore he has, with this great new script :-P | 13:07.25 |
chrisl | Just one thing: "-r" is usually for resolution, not for width and height..... | 13:07.35 |
ManDay | well, it's for ratio. what else should i call it | 13:07.57 |
chrisl | I'm just pointing that could be confusing for other folks.... | 13:08.50 |
ManDay | so could be -v :-P | 13:09.10 |
| everyone would expect that to be --invert-match, right? | 13:09.37 |
| oh, i found a bug :-D | 13:10.40 |
chrisl | Well, not in this context.... my point is, when doing stuff with PDF and Postscript etc, "-r" is usually the resolution | 13:10.57 |
ManDay | come on man, if you criticize it you must have an alternative solution! | 13:11.16 |
chrisl | Possibly "-a" for apect ratio? | 13:12.02 |
ManDay | brilliant. this will be in version 2.0, coming out next hour | 13:12.19 |
tor8 | ManDay: I like margins... nothing worse than text butting up straight against the edge. | 13:26.56 |
ManDay | tor8: I've got a 13 inch ereader and I'm still annoyed by margins taking up screen space | 13:27.29 |
malc_ | tor8: i'm still wondering how to properly configure them with the css style you've commited recently (epub) | 13:27.31 |
ManDay | tor8: not completely remote them, of course | 13:27.46 |
| but some pdf ship with a a 30% to 40% total margin | 13:28.09 |
tor8 | ManDay: now, *reducing* margins for ereaders is something I can see the value of | 13:28.11 |
ManDay | tor8: there we go | 13:28.18 |
tor8 | but eliminating, not so much :) | 13:28.20 |
| malc_: configure what? | 13:28.30 |
ManDay | of course, my program does whatever you desire: reduce, remove, you can even INCREASE them :-D | 13:28.33 |
malc_ | tor8: margins | 13:28.37 |
tor8 | malc_: I still need to figure out how to parse (and represent) @page selectors for per-page margins | 13:29.02 |
| once that's done, I want to introduce user stylesheets so you can set defaults and/or override book styles | 13:29.33 |
malc_ | tor8: oh, great | 13:29.40 |
ManDay | what are you guys talking about if I may ask? | 13:30.03 |
tor8 | malc_: or just add a 'nuke the damn style from orbit, it's the only way to be sure' option | 13:30.05 |
| ManDay: the EPUB reader in MuPDF. It has hard coded 1-em top and bottom page margins, which is what I assume malc_ is wondering about how to change. | 13:30.47 |
ManDay | MuPDF has an EPUB reader?! o_O | 13:31.00 |
| ill be damned | 13:31.02 |
tor8 | it does, as of fairly recently | 13:31.09 |
ManDay | just when i ditched it | 13:31.13 |
malc_ | tor8: :) | 13:31.25 |
tor8 | so still a bit dodgy in many areas, but it works well enough on simple books | 13:31.30 |
ManDay | that's pretty awesome to hear. though I now have to decide between zathura and mupdf again | 13:31.51 |
| sleepless nights | 13:31.56 |
tor8 | :) | 13:32.02 |
| ManDay: I take it that it's the UI you dislike? | 13:32.20 |
ManDay | have you tried zathura? it's far more advanced (as in complex - configurable and extensible and such) and plugin based | 13:33.15 |
| i actually wanted to write an epub renderer plugin for it but didn't get around doint it yet | 13:33.30 |
malc_ | ManDay: zathura has epub plugin | 13:33.54 |
ManDay | i don't remember why exactly i changed but there was a particular reason | 13:33.57 |
malc_ | ManDay: but it's slow and doesn't perform | 13:34.03 |
ManDay | malc_: i'll be damned... | 13:34.04 |
malc_ | zathura itself | 13:34.07 |
| not the epub plugin | 13:34.11 |
ManDay | i haven't noticed any performance problems. but I think I'm going to find out soon cause I'm installing mupdf again | 13:34.48 |
malc_ | ManDay: depends on what your baseline is | 13:37.14 |
ManDay | what do you mean by that? | 13:37.30 |
malc_ | ManDay: to notice performance problems you either have to be dissatisfied or know of something that does the same job better | 13:39.24 |
| if your baseline (comparison) is with xpdf based stuff.. then uh... | 13:39.44 |
ManDay | as I said I've tried both, but i haven't noticed any problems in either | 13:39.48 |
malc_ | good for you | 13:40.15 |
ManDay | tor8: I think I was lying | 13:46.57 |
| I think it's not able to create margins :-/ | 13:47.13 |
| could have expected that. the name is CROPbox after all... | 13:47.28 |
kens | Making teh CropBox bigger than the MediaBox has no useful effect | 13:47.35 |
ManDay | can i simply replace [/CropBox by mediabox ? | 13:48.00 |
| ah well, that would be ADD mediabox | 13:48.10 |
| (since you told me i can't remove the crop box) | 13:48.16 |
kens | You can also modify the MediaBox, and you can even translate the content to a different part of the page. But you will need a /BeginPage procedure for that | 13:48.21 |
ManDay | for both? | 13:48.40 |
kens | You can also achieve cropping by changing the MediaBox to make it smaller of course, and you cna use negative starting oc-ordinates to move the page | 13:49.07 |
| Note that ths is only likely to work with *extermely* recent Ghostscript sources. | 13:49.50 |
ManDay | can I not modify the mediabox in EndPage ? | 13:49.52 |
kens | You can, but you can't translate the content | 13:50.05 |
| And the origin is always bottom left, so you can only add margins at right and top | 13:50.23 |
ManDay | why would I want to translate the content? Isn't that equivalent to just moving the media vox in the opposite direction? | 13:50.28 |
| ah, ok | 13:50.33 |
kens | People usually want increased margins all round or in pairs top/bottom, left/right | 13:51.14 |
ManDay | yes. so bleeding edge gs will interpret negative values for the left/bottom of the mediabox as moving the content and the mediabox remains with 0 0 at the left/bottom? | 13:51.59 |
kens | Not exactly, but it has that effect | 13:52.16 |
ManDay | could you give me a hint as to what operators i will have to look into for moving the content? | 13:52.51 |
kens | translate | 13:53.03 |
ManDay | thanks | 13:53.06 |
kens | Remember you will now need a *BeginPage* routine, not an EndPage, you have to move the origin before you begin drawing | 13:53.37 |
ManDay | yeah i understood | 13:53.46 |
| i think such a change to my program warrants calling it v3.0 now | 13:55.21 |
| also, i'll release a enterprise version which will be charged a premium | 13:55.46 |
kens | ManDay : See : | 13:56.41 |
| http://ghostscript.com/irclogs/2015/04/15.html | 13:56.41 |
| At around 16:23 | 13:56.47 |
| And t works with EndPage too, because I'm cheating by setting the MediaBox negative after creating the output | 13:57.35 |
ManDay | i'm afraid i don't understand that code yet | 14:01.52 |
| what does the stack start off with? | 14:02.08 |
kens | Its an EndPage procedure, so the same as always | 14:02.31 |
| Its starts off by exchanging the two top items on the stack and throwing the new top one away | 14:02.55 |
ManDay | If it is an endpage proc, why does it not start with << /EndPage ... ? | 14:06.00 |
| does the stack contain that name obj? | 14:06.17 |
kens | read furrther | 14:06.59 |
ManDay | oh | 14:07.18 |
kens | IRC ate my / | 14:07.26 |
ManDay | so there is no operator that would be, say, 15 when the 3rd page with -dFirstPage=12 is processed? | 14:21.14 |
chrisl | It wouldn't be an operator, it would be a value - and no, there isn't | 14:22.39 |
| You can work it out - the /FirstPage value (if set) is should be available to you | 14:23.27 |
kens | The way FirstPage currently works, the earlier pages are *never* read, so there's just no way to know | 14:23.41 |
| FirstPage is set in (I thnk) systemdict | 14:24.00 |
| That won't be true if I ever finish my code. | 14:24.29 |
rayjj | kens: that file with the screwy "fake transparency" is due to the funky (or at least unusual) Decode array. If I set it to [ 0 1 0 1 0 1 ] then mupdf (and gs with -dNOINTERPOLATE) show the full intensity colors | 14:26.14 |
kens | rayjj well its still 'something' to do with colour and interpolation | 14:26.35 |
| Turning off interpolation makes the problem go away | 14:26.46 |
rayjj | kens: so, most likely, the interpolation code isn't handing the Decode properly | 14:27.03 |
kens | Yeah coudl be, not really my field | 14:27.17 |
rayjj | kens: thanks for the legwork on putting together the bug | 14:27.40 |
kens | I didn't really, the reporter was on here, and he opened it I just made teh attachments private | 14:28.05 |
chrisl | ManDay: kens is correct, the FirstPage (and LastPage) values are available to you (if they were set) in systemdict. | 14:29.15 |
Robin_Watts | chrisl: Wow. These laptops are dollars == pounds in the states. | 14:29.41 |
ManDay | yeah but i decided to check it outside of the PS in bash and then hardcode the correct value in PS anyway | 14:29.49 |
chrisl | Robin_Watts: I know - sh*t, isn't it :-( | 14:30.07 |
Robin_Watts | but you only get US english keyboards and they don't offer the fat back battery. | 14:30.09 |
chrisl | Robin_Watts: the keyboard doesn't surprise me, but the battery pack does - do people in the US spend less time away from power?? | 14:33.17 |
Robin_Watts | chrisl: I bet you can buy it as an aftermarket mod. | 14:33.58 |
chrisl | Probably, yes | 14:34.15 |
Robin_Watts | Wossa difference between 8.1 and 8.1 Pro I wonder. | 14:38.53 |
| Remote desktop is probably the only thing I care about, and that's hackable. | 14:39.21 |
chrisl | "Horrible", and "Professionally Horrible"? | 14:39.36 |
Robin_Watts | chrisl: mmm. And 54 quid that will pay for an 8Gig SODIMM. | 14:40.00 |
chrisl | I tend to ignore stuff like the Windows versions..... | 14:40.38 |
Robin_Watts | Well, you're going to cripple it with linux, right? :) | 14:40.53 |
| Which processor did you go for? | 14:41.13 |
chrisl | Ahem, "set it free"..... | 14:41.17 |
henrys | cripple? Robin_Watts hasn't used 8.1 obviously. | 14:41.34 |
chrisl | Robin_Watts: Mine's an i5 | 14:41.42 |
kens | They tell me 8.1 is better than 8 | 14:41.48 |
Robin_Watts | I have a choice of 2 i5's and an i7. Same choices that chrisl had I think. | 14:42.08 |
chrisl | Mine's the i5 5300U | 14:42.42 |
Robin_Watts | henrys: I've used 8, and I've used linux. | 14:43.05 |
| And much as I hate 8, I'd hate to be stuck with linux more. | 14:43.19 |
kens | would probably rather use Linux than Windows 8 | 14:43.25 |
| OTOH I have been using Unix like systems for 30+ years | 14:43.47 |
Robin_Watts | The linux desktops have not improved since I used X at uni 20+ years ago. | 14:43.49 |
| And frankly, I'd rather use VMware and Xming. | 14:44.14 |
henrys | If there were some way to just do away with all the charm stuff I'd be okay | 14:44.25 |
Robin_Watts | henrys: AIUI, 8.1 brings that goal a lot closer. | 14:44.41 |
chrisl | Hmm, depends.... if it had to choose between Win 8 and Ubuntu Unity, hmm, I might go back to a text terminal....... | 14:44.48 |
kens | I looked at Unity and ran away | 14:45.23 |
Robin_Watts | henrys: My objection to 8 was the way it'd keep kicking you into the tiled view at every possibly opportunity. | 14:45.27 |
| 8.1 has the start button back, so that happens a lot less. | 14:45.41 |
henrys | Robin_Watts: that's what I mean ... and my trackpad has all these gestures to get me there... I guess I could disable that. | 14:46.00 |
Robin_Watts | henrys: Are you using 8.1 or 8 ? | 14:46.15 |
henrys | 8.1 | 14:46.19 |
kens | chrisl that bug looks like a typical 'do my work for me' Stack Overflow type of request | 14:46.35 |
chrisl | kens: the new one? Yeh, but it's clearly not "critical", so...... | 14:47.05 |
kens | Indeed, I'd reset that as well, and commented on it in my reply :-) | 14:47.20 |
Robin_Watts | And if I get 8.1, I can get MSVC 2013 and start prodding gsview. | 14:47.21 |
| I can get 8.1 Pro and then downgrade to 7, but I'm not sure that's worthwhile. | 14:48.09 |
kens | I'm holding out for 10 before I upgrade Stella and Melanie's computers | 14:48.38 |
| Oooh, we could put GS in the Microsoft Store: | 14:54.31 |
| http://www.digitaltrends.com/computing/windows-store-net-win32/ | 14:54.31 |
| Though I doubt they will approve a console app | 14:54.56 |
ManDay | perhaps if you swipe and pinch | 14:55.33 |
henrys | looks like this will help a lot, I never much looked into it until now: http://www.pcworld.com/article/2055381/how-to-eradicate-metro-from-your-windows-8-1-pc.html | 15:09.04 |
kens | The 'fix WIndows 8' thngs have been around pretty much since it launched :-) | 15:09.59 |
Robin_Watts | laptop ordered. | 16:20.34 |
ManDay | Here, it's so abstract and complicated now that no one will ever be able to fix a bug. Also, it can work on arbitrary dimensional pages (defaults to 2) http://dpaste.com/0HSBVS5 | 16:27.52 |
henrys | oh I | 17:21.47 |
| 'm glad marcosw got that one ;-) | 17:21.58 |
Robin_Watts | The performance change one? | 17:22.14 |
henrys | Robin_Watts: right | 17:22.52 |
Robin_Watts | That's PCL -> PDF | 17:22.54 |
| isn't the short answer 'that didn't work in 9.10' ? | 17:23.03 |
rayjj | mvrhel_laptop: I hope you don't mind that I stole bug 695973 from you ;-) It looks like the check in image_render_interpolate_icc is wrong for: | 17:23.47 |
| need_decode = !((penum->device_color || penum->icc_setup.is_lab) && (penum->icc_setup.need_decode == 0) || gs_color_space_is_CIE(pcs)); | 17:23.48 |
henrys | it worked in 9.10 I'm betting they're seeing what norbert saw but we'll see. | 17:23.56 |
Robin_Watts | I wonder if it's the same 'check every new object against every existing object' thing before. | 17:24.07 |
mvrhel_laptop | rayjj: I am neck deep in blending spaces right now so have at it | 17:24.17 |
Robin_Watts | s/before/as before/ | 17:24.19 |
rayjj | mvrhel_laptop: that's what I thought | 17:24.28 |
| Robin_Watts: yeah, that can be a killer on file with lots of objects if the check isn't really quick | 17:25.41 |
| OTOH, we don't want multiple copies of bitmaps that are for things like the letterhead logo being put in the PDF more than needed | 17:26.36 |
Robin_Watts | rayjj: Absolutely. | 17:26.48 |
ManDay | Is no one interested in a script which can crop higher-dimensional books? | 17:27.04 |
| I've added a commandline argument so that the dimension can be freely chosen: | 17:27.19 |
Robin_Watts | ManDay: We're all very 1 dimension characters. | 17:27.20 |
rayjj | ManDay: script in what language ? | 17:27.27 |
ManDay | http://dpaste.com/3NN70G2 | 17:27.29 |
| here, if you pass -d 4 you can crop hypercubes | 17:27.36 |
| Robin_Watts: it also works in one dimension | 17:29.17 |
| chrisl: also, it now has -a instead of -r, as promised | 17:33.21 |
chrisl | I did see that. I'll save your script, in case I ever have a need for it... | 17:34.40 |
ManDay | great :) if you want any changes done let me know | 17:35.36 |
rayjj | Robin_Watts: do you have time for a question about when to ignore the Decode of an image ? (I'd chat with mvrhel_laptop, but he's hip deep in the blending/color_space transparency issues for Altona pages) | 17:55.36 |
Robin_Watts | rayjj: Sure. | 17:55.49 |
| rayjj: ooh, one of those need_decode lines has a fixme in from me. | 17:57.17 |
kens | Regarding the PCL performance questoin, the change that Norbert tripped over was dpone nearly 5 years ago, and 9.10 is only 20 months old, so I doubt its the same thing exactly. It might well be related, in whch case I'm inclined to say 'faster processing, or less efficietn output, your choice' | 17:57.19 |
rayjj | Robin_Watts: looking at image_render_interpolate_icc in gxiscale.c line 917, it calculates 'need_decode' and it is setting need_decode to false, even though penum->icc_setup.need_decode is true. That doesn't seem right | 17:57.54 |
Robin_Watts | rayjj: Yes. See my note in the landscape version. | 17:58.55 |
rayjj | Robin_Watts: but I'm not sure about the other cases as well. I can see that for Lab colors, we may want to ignore the Decode, but device color and ICC color spaces seem OK | 17:58.59 |
Robin_Watts | The condition is !((a || b) && c || d) | 17:59.56 |
| which seems nasty to me. | 18:00.05 |
| X && Y || Z is a minefield. | 18:00.19 |
| Let's think of it as 'can_skip_decode = ((device_color || lab_color) && doesn't_have_a_decode || CIE_color) | 18:01.56 |
rayjj | Robin_Watts: in image_render_interpolate_landscape there is: need_decode = !(penum->device_color || gs_color_space_is_CIE(pcs) || islab); which will also set need_decode to false because gs_color_space_is_CIE() returns true | 18:02.20 |
| for an ICC sapce | 18:02.25 |
| space | 18:02.27 |
| Robin_Watts: how can you skip Decode for a device_color ? | 18:03.07 |
Robin_Watts | rayjj: Presumably the only way we can ever skip the decode is if 1) there is no decode that needs doing, or 2) it's been done elsewhere already (or will be done in a later step) | 18:03.24 |
rayjj | oops. I chased Robin_Watts away :-( | 18:04.15 |
Robin_Watts | what happened there? | 18:04.25 |
rayjj | you 'left' and came back (from what I saw) | 18:04.46 |
Robin_Watts | yeah, no idea why. other network connections are fine | 18:05.02 |
rayjj | anyway, I don't follow that it's OK to skip decode for device_color or ICC color | 18:05.11 |
| for Lab cs, fine -- since the Lab cs has a required "Range" that is used and doing funky things like trying to "adjust" or invert colors in Lab space doesn't make sense | 18:06.17 |
Robin_Watts | rayjj: Presumably for a lab space the decode is done later then? | 18:07.26 |
rayjj | with PS input, CIEBased colors are risky because they don't have to be at all similar to a "standard" colorspace (i.e. the Alternate space of PDF ICC cs) | 18:07.48 |
Robin_Watts | rayjj: If it's a device color, maybe the decode is done earlier as part of the icc handling? | 18:08.27 |
kens | The Decode is supposed to map the samples into an appropriate range for the colour space | 18:08.45 |
| Which is why it *is* important for Decode to apply to CIEBased spaces I think | 18:09.00 |
rayjj | note that when we are not interpolating, AFAICT, decode is always done | 18:09.14 |
kens | You have to map, say 32757 to +1 for example | 18:09.19 |
| I htnk you always need to apply the image /Decode | 18:09.44 |
Robin_Watts | kens: Yes, I believe the question is not "do we need to apply the Decode at all", it's rather "do we need to decode it HERE". | 18:10.23 |
kens | Hmm, OK I misunderstood then :-) | 18:10.41 |
ManDay | kens: if you have missed it, my oeuvre is done | 18:10.46 |
| thanks for everything | 18:10.51 |
kens | I would guess that the Decode should be applied after interpolation | 18:11.11 |
Robin_Watts | If we have a linear color space, then it's reasonable to do the interpolation first, and THEN apply the decode afterwards. | 18:11.12 |
kens | ManDay, I saw in the logs, congrats | 18:11.17 |
rayjj | kens: Robin_Watts: that wasn't quite my question. For interpolating, I think we need to Decode *before* interpolation | 18:11.22 |
kens | rayjj I htnk you can argue it either way | 18:11.37 |
Robin_Watts | rayjj: If you're downscaling, then doing the decode after the interpolation is more efficient. | 18:12.05 |
rayjj | Robin_Watts: Robin_Watts doing the decode after interpolation that upscales means we are decoding more pixels | 18:12.10 |
kens | But I'm inclined to suspect that applying Decode before interpolation is going to be faster | 18:12.11 |
| and what Robin says | 18:12.21 |
Robin_Watts | If you're upscaling, then (as you say), we want to do it before. | 18:12.25 |
kens | I tend ot thnk of interpolation only for upscaling | 18:12.32 |
rayjj | Robin_Watts: well, the need_decode doesn't have anything about up/down sampling | 18:12.51 |
Robin_Watts | If we are dealing with non-linear colorspaces, then we must colour convert to a linear space before we interpolate. | 18:13.03 |
| And that means the decode must have been done before we get here. | 18:13.11 |
rayjj | kens: we do interpolation for downsampling as well | 18:13.19 |
kens | rayjj I know, but I tend to forget | 18:13.31 |
Robin_Watts | kens: Interpolation is arguably more important for downscaling. | 18:13.40 |
kens | Robin_Watts : I'm unconvinced, but I'm too tired to visualise it at the moment | 18:13.59 |
rayjj | Robin_Watts: right, which is why I can see that Lab would be handled separately (or Decode ignored, altogether) | 18:14.17 |
Robin_Watts | rayjj: I think the condition is malformed. | 18:14.38 |
kens | Also, I think it may be neccesary to turn off interpolation for /Indexed spaces, do we do that ? | 18:14.45 |
Robin_Watts | kens: You can interpolate indexed spaces fine - you just convert them to non-indexed first. | 18:15.13 |
rayjj | Decode is supposed to map sample values from the image data to the colorspace values, and mapping Lab is not needed (Range does that) and is non-linear | 18:15.18 |
kens | I was about to say that | 18:15.21 |
| rayjj Eh ? Are you suggestng you don;t need to apply /Decode to an Lab sapce ? | 18:15.58 |
Robin_Watts | rayjj: I bet the decode handling is rolled into an earlier Lab phase. | 18:16.00 |
| i.e. it will be applied, just not here. | 18:16.10 |
kens | THt's possible, but I'm doubtful | 18:16.23 |
Robin_Watts | But the fact is that "a && b || c" is just wrong | 18:16.32 |
| it's not clear whether thats "(a && b) || c" or "a && (b || c)" | 18:16.54 |
| Now, if the input is a device color, then it will be being fed through an ICC process before it gets here, right? | 18:18.05 |
| hence I bet that has the decode rolled into it. | 18:18.11 |
kens | As I underatand it a device colour has been transfromed into an ICC space yes | 18:18.24 |
Robin_Watts | That's why we can skip the decode if penum->device_color. | 18:18.24 |
kens | You would have to apply the /Decode before conversion to ICC I thnk, you certainly can't apply it afterwards | 18:19.14 |
Robin_Watts | so, the skip_decode = ((device || lab) && icc_setup.need_decode == 0) makes sense to me. | 18:20.16 |
| It's the last term that doesn't. | 18:20.22 |
| rayjj: In the case you are seeing, what sort of color is it? | 18:20.33 |
kens | Assuming that the Lab has also had the decode applied, yes | 18:20.35 |
| Robin_Watts : the colour is an ICCBased space | 18:21.02 |
| Admittedly with a DeviceRGB alternate | 18:21.16 |
rayjj | Robin_Watts: Bug 695973 -- The color space is ICC with 3 components (Alternate is RGB) and the Decode is [ 0.8 1.1 ... ] | 18:21.32 |
Robin_Watts | so the is_CIE is true ? | 18:22.10 |
rayjj | so that maps the range of RGB values 0->0xff to .8 for 0 and 1.1 for 0xff, thus lightening the image | 18:22.18 |
kens | Hmm, I thnk that only applies to 'real' CIE coours ? | 18:22.25 |
rayjj | yes, is CIE include ICC spaec | 18:22.36 |
kens | Oh OK | 18:22.42 |
Robin_Watts | Maybe the condition should be ((device || lab || CIE) && need_decode == 0) | 18:23.07 |
rayjj | gs_color_space_is_CIE has the 4 "real" CIE spaces and ICC space | 18:23.27 |
| oops. I have to run the lunches to the kids. Sorry. back in a bit. | 18:23.52 |
kens | If what Robin_Watts speculates is correct, then doesn't that mean that we apply the Decode to CIE colours when converting into ICC, but (perhaps) not to colours actually defined in an ICC space ? | 18:23.55 |
Robin_Watts | kens: I think the icc_setup.need_decode might mean "we still need to do the decode" | 18:24.31 |
rayjj | Robin_Watts: I think we want need_decode == 0 for Lab | 18:24.39 |
kens | Yeah that would make ense to me | 18:24.40 |
Robin_Watts | rayjj: That's what my modification would do. | 18:24.58 |
kens | Looks plausible to me | 18:25.27 |
rayjj | Robin_Watts: if you are computing 'can_skip_decode', not need_decode | 18:25.39 |
kens | Though I wouldn't rely on me at this time of night | 18:25.43 |
| well need_decode = !can_skip_decode ? | 18:26.01 |
rayjj | have to run... | 18:26.21 |
kens | bye | 18:26.27 |
Robin_Watts | kens: yes. | 18:26.40 |
| rayjj: Yes, my mind can't cope with too many negations, so I removed it :) | 18:26.58 |
kens | So, making the test "...&& can_skip_decode ==1" is the same | 18:27.24 |
Robin_Watts | Aha. Look at 6aa157b4 | 18:27.57 |
kens | Can you give me a URL ? | 18:28.11 |
Robin_Watts | - /* Decide here if we need to decode or not. Essentially, as | 18:28.31 |
| - * far as I can gather, we use the top case if we DON'T need | 18:28.33 |
| - * to decode. This is fairly obviously conditional on | 18:28.35 |
| - * need_decode being set to 0. The major exception to this is | 18:28.37 |
| - * that if the colorspace is CIE, we interpolate, THEN decode, | 18:28.39 |
| - * so the decode is done later in the pipeline, so we needn't | 18:28.40 |
| - * decode here (see Bugs 692225 and 692331). */ | 18:28.42 |
| - /* It is possible that islab should be moved out of conjuction | 18:28.43 |
| - * with need_decode below, but in the absence of a test file, | 18:28.45 |
| - * I'm leaving it where it is. */ | 18:28.46 |
| Not immediately. I have it in gitk. | 18:28.48 |
kens | No problem, I@ll lookat the source | 18:29.00 |
Robin_Watts | 6aa157b4 is mvrhel's introduction of that line. The bit I pasted there is part of what he removed. | 18:29.31 |
kens | Ah! | 18:29.38 |
Robin_Watts | hehe. And that comment was mine :) | 18:30.24 |
kens | :-D | 18:30.32 |
| Oops, back in a while | 18:30.51 |
Robin_Watts | Aha. | 18:31.34 |
| The commit where I introduced that comment was: 73c09fa0 | 18:31.44 |
| and the code before I fiddled said: | 18:31.56 |
| - if ((penum->device_color || | 18:32.10 |
| - gs_color_space_is_CIE(pcs) || | 18:32.12 |
| - islab) && (penum->icc_setup.need_decode == 0)) { | 18:32.14 |
| And that was to fix 692225 | 18:33.29 |
| so, ray, any fix you try should be sure to make sure that you don't break bug 692225 | 18:33.51 |
| and bug 692331 | 18:35.49 |
| rayjj: If you do gitk -- gs/base/gxiscale.c you get a view of the changes in the area. | 18:36.21 |
ManDay | I'm afraid I need your help again :-/ | 18:55.54 |
| I wanted to implement the BeginPage procedure but get a typecheck error I can't make sense of | 18:56.18 |
| oh, i fixed it | 18:57.59 |
| but I don't understand one thing and I'd like to understand it: I'm writing a PS program now and executing that requires actually computing power of some sort. But this is only computed when I run gs. When I view the PDF later, this is not computed again? But a PDF is also PS, so there is still some PS computation going on, just not the one I wrote? Could one say that the program I write write now and | 19:00.54 |
| pass to GS is kind of "baked" into another code which needs less computing power? | 19:00.55 |
kens | PDF si NOT (and normally doe snot contain) PostScript | 19:04.18 |
| THe origianl graphcis model of PDF was the same as PostScript, ths is no longer the case | 19:04.41 |
| PDF, unlike PostScript, is not a programming language, it is a pure description | 19:05.08 |
ManDay | hm, so what happens is that GS takes both the PDF and my PS as input, converts the PS into presentation and adds it into the PDF? | 19:05.36 |
kens | The output of PostScript is markign operations. PDF files only contain marking operations, so when you run a PostScrip program, the output of thqt program is the markign operations. To create a PDF file from that we simply record the marking ops | 19:06.29 |
ManDay | hm | 19:07.04 |
kens | For instance, PostScript contains the rand operator, so you can have a PostScript progra which produces different output every time it is executed, you can't do that in PDF | 19:07.09 |
| In the case of your PDF example, Ghostscript runs a PostScript program which reads ytour PDF file, takes the PDF operators and operands and converts those to equivalen tPostScript marking operations, then 'draws' those. | 19:10.07 |
ManDay | ah | 19:10.18 |
| that i understand | 19:10.20 |
kens | Then it runs your PostScript, and does the same with that program | 19:10.23 |
| FOr a rendering device, you then get a bitmap (or series of them) | 19:10.39 |
ManDay | um do you know which key goes with MediaBox in pdfmark? | 19:10.43 |
| was /PAGE for CropBox, but I can't find anything for MediaBox | 19:10.53 |
kens | FOr PDF output, you get a PDF file which captures the marking operatiosn that were excuted | 19:10.59 |
| THe /PAGE and /PAGES refer to the type of pdfmark, either /PAGE (for this page) or /PAGES for all pages | 19:11.38 |
rayjj | kens: Robin_Watts: I've looked at the logs, and will investigate that comment, and why the Decode is ignored (i.e., not done later) in this case | 19:11.40 |
| Robin_Watts: thanks for the bug #'s to look at | 19:12.00 |
kens | All the *Box operands are either /PAGE or /PAGES pdfmarks | 19:12.13 |
| ManDay a '/' doesn't make a key, it makes a name, you cna use a name as a key in a dictonary, but you can use other things too | 19:13.13 |
| So don't thnk of '/' as a key, it isn't | 19:13.28 |
ManDay | i know, I meant type | 19:17.33 |
| does it make sense to use /PAGES in /EndPage or /BeginPage? | 19:19.11 |
| i think not | 19:19.25 |
kens | Not really, because that will apply to all pages. | 19:19.29 |
| SO only the last one will take effect. | 19:19.36 |
ManDay | yep | 19:20.30 |
kens | Don't forget. if you want to modify /MediaBox you will need to use source no older than 17th April | 19:20.45 |
ManDay | and i understand that if the pages have a /PAGE pdfmark they will overwrite whatever /PAGES say | 19:20.46 |
kens | Err, no, I htnk not | 19:20.56 |
ManDay | kens: I will use translate | 19:20.58 |
rayjj | think of PAGES as the default if an individual PAGE doesn't override it | 19:21.05 |
ManDay | but i need to use both, MediaBox and translate to get all margins right | 19:21.28 |
kens | what rayjj said | 19:21.41 |
ManDay | that's what I said | 19:21.47 |
kens | Its late, and its been a liong day. | 19:22.02 |
| Right I really am off for the nght now, good luck with the interpolaton stuff Ray | 19:23.26 |
rayjj | kens: OK. Thanks. | 19:25.36 |
| too late :-( | 19:25.40 |
ManDay | I'm trying to understand the pdfinfo.ps script, because I want to get the current MediaBox from within a /EndPage proc, but I'm too stupid | 19:33.09 |
| could anyone give me a hint how can I obtain the current MediaBox | 19:33.21 |
rayjj | ManDay: if you are talking about toolbin/pdf_info.ps, then I wrote that | 19:47.34 |
| ManDay: it uses a lot of the internal procs used by the pdf interpreter. We generally are lazy (intentionally) about documenting those since we don't intend them to be (ab)used by those outside. | 19:49.32 |
| ManDay: <int> pdfgetpage <pagedict> is one of them, and <pagedict> <key> pget <value> -true- is another. Together they let you get the MediaBox | 19:52.54 |
| ManDay: but of course, you also need to 'load' the PDF using: File (r) file runpdfbegin | 19:54.01 |
| ManDay: where "File" is the path to the input PDF file. If you have a <file> object from somewhere else, then just use it: <file> runpdfbegin - Note that this sets 'pdfpagecount' to the number of pages in the PDF | 19:58.42 |
| ManDay: generally, for any unknown PS object (like pget), I use: grep /pget Resource/Init/pdf*ps | 19:59.45 |
| since the /pget will be the definition of the pget procedure in the Resource/Init/pdf*.ps files (which is the PDF interpreter) | 20:00.24 |
| ManDay: the nice thing is that runpdfbegin will do any "repair" on the input PDF file that is needed | 20:01.56 |
| ManDay: from within an EndPage proc, you _should_ (untested) if you know that this is a PDF file, runpdfbegin will already have "loaded" the PDF, and you should be able to get the <pagedict> using # pdfgetpage and then /MediaBox pget (which should return <array> -true-) with the MediaBox array | 20:05.47 |
| ManDay: note that mixing internal GS PDF interpreter stuff and a (more or less standard) EndPage proc, is ***SUBJECT TO CHANGE WITHOUT NOTICE*** | 20:06.58 |
| ManDay: the only part we generally provide for 'users/customers' is runpdfbegin that lets you load the PDF as a "dict" and drill down into the Trailer dict (that contains the /Root element, etc.) and find what you need. But if we change somethnig, it will be mentioned in our git commit logs | 20:09.50 |
| ManDay: and note that 'oget' and 'get oforce' and '.knownget' are our friends to handle the variety of ways a PDF can provide information (you will see those liberally used in Resource/Init/pdf*.ps files that comprise our PDF interpreter built in PS) | 20:12.16 |
rayjj | expects that ManDay will soon run away screaming :-) | 20:12.48 |
ManDay | i kinda feel like it, yeah | 20:24.50 |
| maybe someone is stil here, though it's late | 20:26.53 |
| I used the "translate" operator in /BeginPage but now the text is kind of cropped on the right (though the document goes on) | 20:27.18 |
| any idea why? | 20:28.16 |
| on the right is the original document: on the left the document translated by 200pts to the right (In /BeginPage) and the mediabox and cropbox increased (in /EndPage) http://postimg.org/image/5be73zn5n/ | 20:32.02 |
| It seems like increasing the media and cropboxes still crops the content, but not the page | 20:32.26 |
| anyone? It's the last thing i need to fix | 20:35.30 |
| Forward 1 day (to 2015/05/01)>>> | |