Log of #ghostscript at irc.freenode.net.

 <<<Back 1 day (to 2020/12/06)Fwd 1 day (to 2020/12/08) >>>20201207 
velix ray: Microsoft fixed the Problem in Office 2019!11:29.12 
  It's adding the missing bboxes :D11:29.22 
  Funny. Microsoft fixes a bug only in a major release.11:29.38 
  So you need to pay again for the bugfix ...11:29.46 
  Damnit. After manual fixing of 152 pages, I'm getting ""Operator 'g' not allowed in this current state. " :-)13:09.38 
  Yipeeeeeeee... I've just reflown it as PDF/A, which rewrote the structure.13:15.15 
Antonio81 Hello everyone14:17.36 
  is there a way to force all PDFs to be A4 (strict) size?14:18.11 
artifexirc-bot <KenSharp> use -dFIXEDMEDIA and -sPAPERSIZE=A414:19.32 
Antonio81 I have a pdf which is 215.9 x 279.4 (mm) and I want it to always be 210 x 290 (mm)14:20.42 
  it is not working14:20.46 
artifexirc-bot <KenSharp> In what way not working ?14:20.52 
Antonio81 the pdf is becoming 209,5 x 271,214:21.08 
  and Im using an automated script to print the pdfs14:21.21 
  and since the printer does not recognize the size it keeps asking me to select the tray14:21.37 
  but if I use a "good" pdf after ghostscript everything works14:22.05 
artifexirc-bot <KenSharp> Well I can't see any way that would happen but without seeing the input file, and knowing the command line and version of Ghostscript you are using (ideally also the OS and where you sourced Ghostscript from) I can't really comment.14:22.29 
Antonio81 well, the input file i cannot send to you :S14:22.52 
  but the other stuff i can tell you14:22.59 
artifexirc-bot <KenSharp> Then its hard to see how I can help you. Perhaps you can find another file14:23.10 
Antonio81 "C:\Program Files\gs\gs9.53.3\bin\gswin64c.exe" -q -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=594 -dDEVICEHEIGHTPOINTS=841 -sDEFAULTPAPERSIZE=a4 -dPDFFitPage -dFIXEDMEDIA -dCompatibilityLevel=1.4 -dBATCH -dNOPAUSE -o D:\TMP\out1.pdf -c "<< /BeginPage {0.985 0.985 scale 10 15 translate } >> setpagedevice" -f D:\TMP\GR_6560-2020_sentDLS_02Dez20.pdf14:23.14 
  forget the device width and height14:23.46 
  "C:\Program Files\gs\gs9.53.3\bin\gswin64c.exe" -q -sDEVICE=pdfwrite -sDEFAULTPAPERSIZE=a4 -dPDFFitPage -dFIXEDMEDIA -dCompatibilityLevel=1.4 -dBATCH -dNOPAUSE -o D:\TMP\out1.pdf -c "<< /BeginPage {0.985 0.985 scale 10 15 translate } >> setpagedevice" -f D:\TMP\GR_6560-2020_sentDLS_02Dez20.pdf14:24.06 
artifexirc-bot <KenSharp> Well you've set the media size twice, once with DEVICEWIDTHPOINTS and DEVICEHIGHTPOINTS and once with PAPERSIZE14:24.12 
Antonio81 this is the one im using14:24.13 
  that was a test I was doing14:24.33 
artifexirc-bot <KenSharp> Oh and you've scaled the content **and** used PDFFitPage14:24.36 
Antonio81 gs is 9.53.314:24.42 
artifexirc-bot <KenSharp> Which is a bad idea14:24.43 
Antonio81 and os is Windows14:24.45 
artifexirc-bot <KenSharp> I would start by dropping the setpagedevice -dPDFFitPage will do that for you14:25.40 
Antonio81 "C:\Program Files\gs\gs9.53.3\bin\gswin64c.exe" -q -sDEVICE=pdfwrite -sDEFAULTPAPERSIZE=a4 -dPDFFitPage -dCompatibilityLevel=1.4 -dBATCH -dNOPAUSE -o D:\TMP\out1.pdf -f D:\TMP\GR_6560-2020_sentDLS_02Dez20.pdf14:25.51 
artifexirc-bot <KenSharp> -o includes -dBATCH and -dNOPAUSE so you don't need all of those14:26.02 
  <KenSharp> OK well without seeing the input file I can't think of a good reason why that produces anything other than an A4 output file14:26.29 
Antonio81 ok14:34.17 
  I've managed to create a sample pdf14:34.23 
  do you want to take a look?14:34.33 
artifexirc-bot <KenSharp> Put it somewhere I can grab hold of it and I'll take a look14:34.37 
  <KenSharp> Dropbox or something will do fine14:34.44 
Antonio81 mediafire, is that ok?14:34.48 
artifexirc-bot <KenSharp> Never used it....14:34.58 
  <KenSharp> Try it and we'll see14:35.02 
Antonio81 http://www.mediafire.com/file/e9x9qcsre8j4zgz/Test_PDF.pdf/file14:35.52 
  can you dl it?14:35.56 
  those are the original dimensions14:36.19 
  and if I process it with gs the dimensions wont change to 210 x 29714:36.40 
artifexirc-bot <KenSharp> Yes I have the file14:36.40 
Antonio81 ty14:36.44 
  hum, nvm14:37.34 
  with gs the dimensions are correct14:37.41 
artifexirc-bot <KenSharp> Right14:37.46 
Antonio81 it has to be something with the original pdf14:37.53 
artifexirc-bot <KenSharp> Seems likely14:37.59 
Antonio81 maybe some kind of protection14:38.01 
artifexirc-bot <KenSharp> Possibly it has a CropBox/ArtBox/BleedBox/TrimBox14:38.11 
Antonio81 thanks, ill try to figure it out14:38.17 
  are you there?15:13.55 
artifexirc-bot <KenSharp> the bot certainly is 🙂15:14.03 
Antonio81 sure15:14.07 
  didn't know who I was talking to :D15:14.15 
  I've got the original pdf file here15:14.28 
artifexirc-bot <KenSharp> Doesn't it echo my nick ? Its supposed to15:14.30 
Antonio81 It does15:14.34 
  but I had to reload the page as chrome stopped working15:14.46 
artifexirc-bot <KenSharp> Oh, well me then 🙂15:14.48 
Antonio81 If you want to take a look, the file is there15:15.00 
  the original with the problems :D15:15.09 
artifexirc-bot <KenSharp> I've got the file15:15.18 
  <KenSharp> Running the file with this command line: gswin64c -dDEVICEHEIGHTPOINTS=595 -dDEVICEWIDTHPOINTS=842 -dFIXEDMEDIA -dPDFFitPage -sDEVICE=pdfwrite -o out.pdf \temp\GR_6560-2020_sentDLS_02Dez20.pdf15:17.24 
Antonio81 yes15:17.42 
artifexirc-bot <KenSharp> produces a PDF file where the output is 8.26 by 10.69 inches, as reported by Acrobat15:17.49 
  <KenSharp> The MediaBox is 0 0 842 595 but the CropBox is 36.0 0 806.0 595.015:18.47 
  <KenSharp> So that's almost certainly your problem, whatever you are sending the file to is trying to use the CropBox15:19.04 
  <KenSharp> NB there's a Rotate 90 in there which is why the media and crop boxes are apparenlty landscape15:19.36 
  <KenSharp> And indeed the PDF file has an unusual layout, the Pages tree has a CoprBox and a MediaBox set at the root node, so all the pages inherit it, both are set to be Letter {612 792]15:21.37 
Antonio81 and is there any way around it?15:22.01 
  and force it 8.3 by 11.7?15:22.15 
artifexirc-bot <KenSharp> Well you coule get the file generated without the CropBox15:22.18 
Antonio81 but thats f.ed up :D15:22.41 
artifexirc-bot <KenSharp> Complain to the vendor of the printer or whatever it is you are sending it to that the CropBox is the wrong thing to be using15:22.43 
Antonio81 the client sends the pdf that way15:22.48 
artifexirc-bot <KenSharp> There's nothing technically wrong iwth what the client has sent you15:23.01 
  <KenSharp> The consumer you are sending the PDF file to should do a more sensible job with the CropBox15:23.19 
Antonio81 is it possible to remove the cropbox?15:23.19 
artifexirc-bot <KenSharp> Yes, but its non-trivial15:23.46 
  <KenSharp> You need to send a /PAGES pdfmark to Ghostscript's pdfwrite device15:23.58 
Antonio81 damn15:24.44 
artifexirc-bot <KenSharp> Actually it looks like you can't 'remove' the CropBox that way15:25.25 
  <KenSharp> You could set it to be the same as the MediaBox15:25.34 
  <KenSharp> [ /CropBox [0 0 595 842] /PAGES pdfmark15:26.02 
  <KenSharp> Somewhat cleverer programming could retrieve the current page widhth and height and use that15:26.33 
  <KenSharp> So =c "[ /CropBox [0 0 currentpagedevice /PageSize get dup 0 get exch 1 get ] /PAGES" -f after the PDF file name **might** work15:29.15 
  <KenSharp> Hmm that's supposed to be a -c15:29.46 
  <KenSharp> Anyway, that's the best I can suggest. Please note the terms of the AGPL licence, since you seem to be using Ghostscritp in a commercial environment.15:30.35 
  <KenSharp> Anyway, that's the best I can suggest. Please note the terms of the AGPL licence, since you seem to be using Ghostscript in a commercial environment.15:30.44 
Antonio81 how do you get those properties?15:36.28 
  any special tool?15:36.31 
artifexirc-bot <KenSharp> Which proerties ?15:36.44 
Antonio81 cropbox and media size15:37.29 
artifexirc-bot <KenSharp> Oh I just read the PDF file15:37.37 
Antonio81 do you open it with notepad++?15:40.14 
artifexirc-bot <KenSharp> No Microsoft Visual Studio, but any decent editor will do15:40.31 
Antonio81 ok, thanks15:40.37 
artifexirc-bot <RayJohnston> you can also get it using pdf_info.ps15:40.58 
  <KenSharp> Or MuPDF or any of a whole range of tools, but the question was how **I** did it 🙂15:41.24 
  <RayJohnston> mutool info15:41.36 
velix ray_laptop: I finally did it! 100% valid PDF/UA. syntax fine, semantic ... about fine.15:48.56 
  Office 2019 is producing shockable good PDFs.15:49.46 
ray_laptop velix: awesome!15:50.35 
velix it's hard to produce PDFs for the blind... I've done my best.15:51.01 
ray_laptop velix: so you solved the image BBox issue ?15:51.27 
velix ray_laptop: No, Microsoft did it for me. Office 2010-2016: borken, 2019 (and up): fixed.15:51.45 
  ray_laptop: my "hack" with an empty bbox also worked.15:52.20 
  ray_laptop: I've triend screenreaders and they worked fine.15:52.31 
ray_laptop velix: oh, good. That's a lot simpler than digging around inside PDF's trying to fix them15:52.33 
velix ray_laptop: Nah, I did that tonight before a friend came up with Office 2019 this morning.15:52.51 
  I'm pretty fine with PDF internals...15:52.57 
  I'm angry about all the people who say: "you cannot edit PDF files".15:53.26 
  or even "you're not allowed to edit them" :D15:53.36 
ray_laptop mupdf with the JS or Python api makes it reasonable15:53.45 
  velix: well if it has digital signature, at least you can tell if someone has15:54.21 
velix ray_laptop: stop making me interested in the API - I don't have time for this now :D15:54.49 
ray_laptop ha ha15:54.57 
velix ray_laptop: That's what christmas holidays are for15:54.58 
  ray_laptop: who has money for digital signatures? they're $$$ and €€€ and other currency symbols.15:55.25 
  I also have started a trial of Acrobat DC 2020. My god - ow many PDF/A formats are there now?15:56.54 
artifexirc-bot <KenSharp> Depends how you count them15:57.23 
ray_laptop velix: I'm not sure what we do for testing mupdf's digital signing -- maybe we are paying for a certificate service. But apparently it is a sought after feature for mupdf15:57.31 
velix ray_laptop: No, I mean a certificate to sign PDF is expensive.15:57.55 
  KenShap, 1a, 1b, 2a, 2b, 2e ... and even 3 and 4 is there.15:58.13 
  okay, we I knew PDF/X4 already15:58.29 
artifexirc-bot <KenSharp> Then there's a and b versions of those16:03.06 
  <KenSharp> And ua as you know16:03.09 
  <KenSharp> and ZugFeRD which is another special purpose variant16:03.41 
  <KenSharp> PDF/X1 to 416:03.51 
  <KenSharp> IIRC PDF/A-4 isn't released yet, or wasn't last time I looked16:04.09 
  <KenSharp> Pretty sure there are some other variants as well that I cna't remember offhand16:04.40 
velix PDF/E16:07.03 
  But you can mix PDF/UA with others.16:07.10 
  I've just created PDF/UA/A2b16:07.28 
  PDF/UA+A2b ?16:07.37 
artifexirc-bot <KenSharp> Pretty sure that u is just another state of PDF/A like a or b16:09.43 
  <KenSharp> So PDF/A-1a PDF/A-1b16:10.04 
  <KenSharp> PDF/A-2a, PDF?A-2b, PDF/A-2u16:10.20 
  <KenSharp> PDF/A-1 can't have a u status16:10.31 
  <KenSharp> IIRC the 'a' status includes Unicode information, whereas b may or may not. The u status indicates Unicode informaiton is present, so for those versions which support it, its between a and b16:11.59 
  <Robin_Watts> Signing a PDF doesn't cost anything.16:16.36 
velix No, PDF/UA is Universal Accessibility.16:17.20 
artifexirc-bot <Robin_Watts> You use acrobat to generate yourself a .pfx file - doesn't cost anything.16:17.30 
velix Robbin_Watts: Sure, but you can't validate it against a service ;)16:17.41 
artifexirc-bot <Robin_Watts> You can then "self-sign" PDFs.16:18.01 
velix It's like signing websites with a self created certificate (before Let's Encrypt came).16:18.03 
  KenSharp: https://en.wikipedia.org/wiki/PDF/UA#Description16:18.17 
artifexirc-bot <Robin_Watts> Right. It's enough to know that a given person signed it.16:18.18 
velix Sorry for asking, are you all on Matrix now? No more IRC?16:18.30 
artifexirc-bot <Robin_Watts> We're on Discord.16:18.42 
  <RayJohnston> Matrix ?16:18.44 
velix ah okay.16:18.46 
  RayJohnston: Yeah, many channels have switched to Matrix.16:18.56 
artifexirc-bot <Robin_Watts> Matrix is an alternative messaging technology.16:19.00 
  <KenSharp> @velix, yes but 'u' is a category of PDF/A files, like a and b16:19.01 
velix KenSharp: I see. confusing.16:19.17 
artifexirc-bot <KenSharp> UA is, bascially, PDF/A-1a16:19.22 
  <RayJohnston> velix: Robin did bots to cross link from IRC<->discord16:19.23 
velix Yeah, but I need to type your nick names all the time ;)16:19.42 
artifexirc-bot <Robin_Watts> The IRC channels are bridged to our Discord, so the IRC channels will remain supported for the forseeable future.16:19.49 
velix ray_laptop: <-- works16:19.53 
  Slack has dropped IRC support. That was sad.16:20.08 
artifexirc-bot <Robin_Watts> velix: Yes. Lack of Nick completion is a pain.16:20.26 
velix Robin_Watts: I'm fine with that. Not much traffic in here.16:20.39 
artifexirc-bot <Robin_Watts> You can bridge slack and irc using matterbridge in the same way as we have done here.16:20.52 
velix Ah, I've read about matterbridge.16:21.14 
  Nice to see it in action.16:21.23 
ray_laptop velix: yeah, we considered slack when discussing having something more friendly for our non-tech staff -- and ANYTHING is better that skype, IMHO16:21.46 
velix and tams.16:22.03 
 <<<Back 1 day (to 2020/12/06)Forward 1 day (to 2020/12/08)>>> 
ghostscript.com #mupdf