IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2016/04/24)20160425 
nemo So. I wanted to experiment w/ reducing size possibly simplifying rendering of a pdf by stripping embedded fonts15:02.36 
  ghostscript seemed the natural way to do that15:02.41 
  but, well, every time I try to do something w/ gs I end up spending half an hour on the man page15:02.57 
  didn't run into a simple commandline that did *only* that in a quick search, so thought I'd ask here15:03.19 
kens Beware, Ghostscript and the pdfwrite device do not simply 'manipulate' a PDF file, they create a brand new PDF file where only the visual appearance is likely to be consistent.15:03.27 
  There is no method in GS+pdfwrite to remove a font15:03.46 
  You might be able to do it with the NeverEmbed array15:04.32 
  I haven't specifically tried that15:04.39 
nemo mm15:04.42 
  kens: I knew a new pdf was created, but I thought it could be kinda like w/, oh, movie encoding where you can chose to copy audio or video but just shift container15:05.09 
kens Which version of GS are you using ?15:05.10 
  nemo, no, that's not how it works at all15:05.24 
nemo that is, I'd generate a new pdf but it wouldn't change any of the internal image compression, vectors, whatever15:05.26 
  just new pdf - fonts15:05.31 
kens If you are using the latest version, 9.19, then read the 'Overview' in VectorDevices.htm15:05.39 
nemo heh. 9.10 is installed, but can do a new build I guess15:06.05 
  have had to do that before..15:06.13 
kens 9.10 is a little old now15:06.18 
nemo so, can gs do roughly what I'm hoping for, before I burn too much time on this?15:06.49 
kens THere is a NeverEmbed distiller parameter which will take a list of fonts which should not be embedded in the output. You could probably use that. No guarantees on what the final result will look like though15:06.56 
Robin_Watts_ nemo: MuPDF allows you do manipulations on pdf files where the internal compression, vectors etc, are unchanged, but even that won't let you strip fonts.15:06.57 
nemo kens: the goal was mostly to reduce load time / render time of a simple pdf in PDF.js15:07.03 
  hm... I wonder if this is amenable to just manual editing in a hex editor or something ☺15:07.23 
kens -c "<</NeverEmbed [/NameOfFont]>> setdistillerparams -f15:07.27 
nemo and yeah, might look like crap, just wanted to see15:07.45 
kens If you delete data in a PDF file then the xref table offsets will be incorrect, makign it an invalid file15:07.52 
nemo kens: PDF.js already has a fallback to helvetica for the embedded gothic apparently15:07.58 
kens Well, see the command above15:08.10 
nemo tries15:08.14 
kens The codumentation notes, in particular (note 13) that you cannot use NeverEmbed with the ps2pdf script15:09.16 
nemo in this particular case going from powerpoint → PDF15:09.41 
  durn. /NeverEmbed doesn't take wildcards. was hoping ☺15:10.31 
  I see someone else tried that too from a search15:10.36 
kens No, you must specify the font name(s) precisely15:10.46 
  Oh, and if the font is a subset you will need to include the subset prefix15:12.32 
tor8 kens: nemo: with mutool run you could save http://pastebin.com/raw/FbHGi5nq and run that script to delete embedded font files15:25.00 
  it will go *very* badly if you have identity-h encoded fonts though.15:25.09 
kens That kills all fonts ?15:25.34 
tor8 it loops through all objects in the file, if it has /Type/Font then it nukes the /FontFile entries in the font descriptor15:26.10 
kens Right15:26.32 
tor8 you'll probably want to run it through pdfclean -g afterwards, since the script doesn't actually remove the objects it just unlinks them15:27.58 
nemo gm15:28.06 
  er15:28.07 
  hm15:28.08 
  I've never run mutool before. how do I pass it your script?15:28.16 
  can't hurt to try this15:28.18 
tor8 nemo: save it as killfonts.js and then run "mutool run killfonts.js input.pdf output.pdf"15:28.40 
  mutool run is very new, you'll need the latest mupdf release. preferably from git.15:28.59 
nemo ah15:29.13 
  how about this 1.9 release timestamped the 19th?15:29.56 
kens you want 1.9a15:30.06 
tor8 nemo: 1.9 should also work, I still haven't uploaded a new windows build15:30.21 
  for the 1.9a fix15:30.31 
kens chides tor815:30.52 
nemo just gonna be a source build15:30.56 
tor8 nemo: you might need to change the 'new PDFDocument' line to 'new mupdf.PDFDocument'15:31.52 
tor8 dinners.15:32.32 
nat54 I was having problems building mupdf for android with ndk r10e and r11. Most errors are from ../thirdparty/mujs/jsmath.c with bunch of undefined reference errors. Can some one help me out please??18:30.40 
nemo nat54: folks who were helping me disconnected 2h ago18:41.27 
  nat54: mupdf website does have android prebuilts, but if you're missing deps I guess you're just gonna have to track down and install 'em18:41.56 
nat54 memo:can you help me? 18:42.32 
  Ya I know that, but just trying to build my self like removing some cjk fonts.18:44.26 
nemo shrugs18:46.50 
  not really no18:46.55 
  not too familiar w/ building for android18:47.05 
  if I was maybe our Hedgewars android release wouldn't be 4 years out of date18:47.14 
Robin_Watts_ nat54: (For the logs) probably that you are building with the 64bit version of the ndk.19:01.52 
rayjj mvrhel: (for the logs) I am trying to enable the UseFastColor "nocm" mode when the ICC input profile data_cs is one of gsRGB, gsGRAY or gsCMYK. It is working, EXCEPT I am tripping over a memory issue20:59.52 
nat54 nemo: now it is working with ndk r10e. Thanks.21:01.45 
rayjj mvrhel: specifically, the link_handle is opaque to the GC (as it generally should be for a "real" cms), so I changed its allocator over to mem->non_gc_memory. That helps, but the nocm_link_t has a "*pis" element in it, and that is in GC memory which can be fiddled with by restore, or reloc21:02.45 
  It seems like the code is actually copying those into a "fake" imager_state, so I think all I will need is to make those also be in non_gc_memory. Does that sound right ?21:08.24 
  mvrhel: (for the logs) Thanks for the phone call. I am trying changes to use non_gc_memory for the nocm_link_ structure and its components22:13.41 
 Forward 1 day (to 2016/04/26)>>> 
ghostscript.com
Search: