Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2016/12/05)20161206 
diwakar I'm having problems compiling mupdf in debina (testing). It gives lots of linker error messages. see https://nopaste.me/view/91580db7 09:46.39 
  *debian09:46.46 
malc_ diwakar: are you using submodules?09:48.32 
diwakar yes it's cloned from the git repository and I'm using submodules09:49.05 
malc_ diwakar: freshly cloned right?09:50.03 
diwakar the docs/example.c file however compiles with extra -ljpeg added to the documented gcc command09:50.38 
  malc_: yes09:50.44 
malc_ diwakar: is $mupdf/thirdparty/ populated?09:51.55 
diwakar malc_: yes it is09:53.12 
malc_ diwakar: followed thirdparty/README ?09:54.11 
diwakar malc_: yes I did "git submodule update --init" after cloning09:55.16 
malc_ diwakar: then I can only suggest waiting for artifex dudes to answer you09:57.00 
kens It will be a few days before anyone can help with this, the staff are (mostly) traveling back from a staff meeting today10:08.59 
  You are not trying to use shared libraries though ?10:09.59 
diwakar I don't know. I just did what was written in the README files10:10.53 
kens Hmm, well that ought to be sufficient10:11.08 
  diwakar : where (and how) did you get the MuPDF source you are using ?10:13.34 
diwakar cloned from git.ghostscript,com/mupdf.git10:14.09 
kens OK I'm just cloning that now, give me a minute10:14.22 
  Not on Debian mind....10:14.39 
diwakar kens: which one 10:15.38 
kens I'm using Fedora10:15.48 
diwakar kens: ok10:15.53 
kens Well, I get a completely different problem10:18.48 
  Seems harfbuzz requires a C++ compiler/linker or something10:19.02 
diwakar what is harfbuzz?10:20.03 
kens Its a text thing10:20.36 
malc_ kens: harfbuzz is all C++10:20.53 
kens Since I don't have a full C++ build environment installed I can't compile it10:21.03 
  malc_ : Yes I know10:21.12 
  I'm trying to sort out gcc now10:21.26 
malc_ kens: "or something" tripped me off10:21.33 
kens I'm a bit surprised MuPDF includes this since I thought Tor was against C++10:21.43 
malc_ he is10:22.03 
  but my suggestion to use m17n didn't sit well with him for whatever reason10:22.20 
  and it's not like harfbuzz needs boost or something10:22.32 
  and given that all the C compilers these days (gcc included) are written in C++ the point becomes moot10:22.50 
kens Well, my gcc won't compile harfbuzz10:23.50 
malc_ very strange10:25.27 
kens Lets see if this will work....10:25.57 
  40MB download...10:26.05 
  OK sems like that fixed gcc10:28.07 
  and jpeg builds fine for me10:28.34 
  GL doesn't, but that's because I don't have the right dependencies installed10:28.55 
kens builds again with HAVE_GLFW=no10:30.29 
  Well, the build works OK for me10:33.01 
diwakar is the problem debian then10:34.03 
kens I'm not enough of a Linux guru to know I'm afraid10:34.19 
diwakar It doesn't need any shared libraries installed does it when I'm using submodules10:35.00 
kens Ata a guess I'd say that you have somehow managed to build MuPDF with libjpeg as a shared library, and the shared library is not availabale10:35.19 
  If you build MuPDF 'as is' it should not require (or use) any shared libraries)10:35.47 
  I'm afraid you're going to have to wait form someone more knowledgeable to comment10:36.42 
diwakar maybe uninstalling them will help. 10:36.58 
kens You might get a response form one of the MuPDF developers in a few hours10:37.17 
  Its currently 05:37 am where they are10:37.33 
diwakar Was mupdf api changed recently mainly the function 'fz_get_pixmap_from_image'11:02.44 
kens The API changes fairly frequently11:08.15 
diwakar so I noticed11:11.27 
  I cloned the repository and did all the things from the start. Now it's building without any errors. Thanks guys11:29.45 
halabund Hello everyone!11:48.34 
  I’m here to ask if Ghostscript of MuPDF (mutool?) can do a certain thing. I always get useful responses in this channel.11:48.55 
  I used to use Multivalent to compress PDFs effectively without destroying any parts, and to remove any junk Illustrator may insert at the end (i.e. the “editable” version of the document) using its -nopagepiece option.11:49.50 
  Many years ago the authors of Multivalent decided that open source is no good for them and purged all command-line capable versions form the internet. I still have an old version from 2006, but it’s getting unreliable these days and the unfixed bugs annoy me.11:50.35 
  Can GS or MuPDF do the same? 1. Remove non-essential info, such as the editable version 2. effectively compress without touching the contents at all (no rasterizing, no lossy compression, etc.)11:51.21 
  â€œmutool clean” does not remove this junk data.11:52.26 
  I tried mutool -l -z -ggg11:54.26 
kens halabund MuPDF or Ghostscript will do effectively what you want (I think). Ghostscript does it as a side-effect of the way it works. Only objects which are used and make marks on the page are sent through the pdfwrite device, and so extraneous stuff gets dropped.13:07.23 
  MuPDF (mutool infact) has a 'clean' mode which does something similar.13:07.42 
halabund kens: do you know which options to clean I should use to make it drop that data?13:08.06 
  with mutool I mean13:08.11 
kens Note that Ghostscript **will** 'touch the contents', see ghostpdl/doc/vectordevices.htm for an explanation of why.13:08.18 
  halabund : I am not a MuPDF exepert, and teh developers are currently travelling back from a staff meeting..13:08.40 
  If you have an example file then I could look at it and maybe help13:09.07 
halabund that’s why I wanted to stay away from Ghostscript. I wasn’t 100% sure about what unexpected transformations it may do. But I can always check manually, for the moment, if everything seems fine. So I’ll just use Ghostscript then.13:09.31 
  Yes, I have an example:13:09.33 
kens I normally recommend people *don't* do multiple transformations through Ghostscript, but t a lot of people do it. Many think they are 'compressing' files :-)13:10.11 
halabund Here’s a file: https://dl.dropboxusercontent.com/u/38623/u.pdf It’s ~800 kB due to stuff that Illustrator appended to it. THat stuff is not used by PDF viewers. It’s the main thing I want to get rid of. 13:10.52 
kens But in general Ghostscript and the pdfwrite device do a pretty good job, if you don't play with the default settings.13:10.56 
  I'll grab the file and look13:11.04 
  Illustrator includes its entire original document format in PDF files :-(13:11.23 
halabund This is a file I made myself, so I could have saved it without including all that. But I don’t always have access to Illustrator and I do receive such files form others.13:11.37 
kens Yes, most people have no clue....13:12.00 
halabund I always clean it with Multivalent and its “-nopagepiece” option. Unfortunately sometimes (rarely) Multivalent messes up embedded bitmaps and it’s no longer being developed.13:12.16 
kens I have the file, let me have a quick play, it may need one of the MuPDF developers to tell you more though.13:12.25 
  Hmm, simple clean made it biggr O.O13:14.01 
halabund I assumed mutool couldn’t remove this data.13:14.33 
  The -z option to “clean” makes it a bit smaller, but not by much13:15.07 
kens Well, the illustrator document *is* referenced, its down as /Private in the /Illustrator dictionary referenced from the Page dictionary13:15.35 
halabund The -s option, “clean content streams”, removes the content for some reason. I don’t understand what this option is supposed to do.13:15.41 
kens So I guess that MuPDF won't remove that without some work.13:15.48 
  -s maintains the illustrator data for me13:16.34 
  Ghostscript drops the file to 2Kb13:17.26 
halabund Ah, sorry, I actually used this full command line:13:17.27 
  mutool clean -s -z u.pdf13:17.32 
  This makes the black rectangle disappear. -s doesn’t. I didn’t realize this.13:17.43 
  Thanks for the help! I think I’ll stick to Ghostscript for now.13:18.04 
kens It would be possible without too much effort to have MuPDF drop the data, but its outside my ability I'm afraid13:18.29 
halabund It’s only the combination of -s and -z that removes the content.13:18.32 
kens The main thing to watch for with GS is JPEG images13:18.40 
  -z flate compresses the data, I suspect that dropping the object is probably co-incidental, and probably not intended13:19.11 
halabund You mean a bug? :)13:19.22 
kens Well, possibly :)13:19.37 
  I don't know enough to be sure13:19.43 
halabund Should I report this?13:19.58 
kens With GS, JPEG images currently get decompressed, and the default is to compress colour image data as JPEG, so the double conversion is bad. I hope one day to get hte time to prevent the decompression (its on my list).13:20.22 
  halabund : I'm not certain its a bug, the developers will read this, so I'd let them decide13:20.39 
halabund OK, then mentioning here was good enough13:20.59 
  Thanks for the help!13:21.04 
kens NP13:21.07 
tor8 halabund: the -s option to mutool clean will rewrite the graphics command stream, and may (but should not) cause graphics changes13:27.22 
  halabund: the -z option should NEVER have any visible effect (other than compressing uncompressed internal PDF streams)13:27.49 
  so I would suggest you open a bug against mupdf and attach the file and I'll investigate13:28.18 
chrisl_x250 Dropping the embedded Illustrator file seems like a good feature to have for mutool13:28.43 
tor8 halabund: mutool clean -gg -s -z is a good set of options for reducing size and cleaning up invalid but parsable stuff13:29.13 
  halabund: mutool run is a swiss army knife tool, you can write a small javascript that uses mupdf functions and use that to strip or edit files whichever way13:29.49 
  chrisl_x250: have you had breakfast yet?13:30.29 
chrisl_x250 tor8: no13:30.42 
tor8 I'm waiting for sebras to show up on IRC, but if not the plan is to head down at 913:30.57 
  if you want to join us13:31.09 
chrisl_x250 Yeh, that sounds good13:31.22 
  Thanks13:31.25 
  tor8: I suspect sebras might be enjoying some extra sleep time - we were all pretty tired when we got back last night13:32.32 
tor8 chrisl_x250: yeah. except I got an email from him an hour ago... :)13:32.50 
  but that is no evidence he hasn't fallen asleep again13:33.23 
chrisl_x250 tor8: er. okay...... or maybe he's already out on the slides ;-)13:33.41 
halabund tor8: OK, I’ll do that13:38.50 
  tor8: Is there any other documentation for mutool than “mutool clean -h”?13:40.18 
tor8 there is a man page (docs/man/mutool.1) but it does not add much more information than you already get by 'mutool clean -h'13:41.58 
kens tor8 this seems to be a regression, an old version of MuPDF didn't drop the content, I was just pulling over the current code and rebuilding it to test here.13:53.41 
kens was also eatring lunch13:54.37 
  chrisl_x250 : did you enjoy the pigs ?13:55.08 
chrisl_x250 kens: the pigs were strange and hilarious - you don't actually swim with them, 'cause the water's too shallow. It's more swimming pigs.13:56.08 
kens :-)13:56.18 
chrisl_x250 The iguanas were fun, although a few were a bit bighty13:56.57 
  A few of us came away with nipped fingers13:57.13 
  Anyway, heading down for breaky13:57.32 
tor8 chrisl_x250: which room are you in? I'm going down to pick up sebras now, should we come knock at your door?13:57.38 
chrisl_x250 I'm in 8135. So, leave now, and I'll meet you at the elevators13:58.05 
tor8 or meet at sebras' door, 612413:58.10 
chrisl_x250 Okay13:58.20 
kens Sory, was away from desk briefly, cat just threw up on the kitchen floor. Presumably this is payback....14:01.38 
  tor or Robin : I just updated to the latest code in Git and I can't build the WIndows solution (in VS 2005) I get @14:08.42 
  1>c1 : fatal error C1083: Cannot open source file: '..\..\thirdparty\openjpeg\src\lib\openjp2\thread.c': No such file or directory14:08.42 
  when building thirdparty.lib and of course after that everything goes to pieces14:08.42 
  Note that there is no thread.c in the openjp2 directory14:09.43 
  Removing thread.c from the solution gets me past that, then I get an unresolved external on js_newobjectx refrenced in murun_main14:11.39 
  OK I give up on that one, there is no definition of that function that I can find.14:14.05 
  renaming occurences of js_newobjectx (3 of them) to js_newobject and removing thread.c from the openjpeg thirdparty module allows me to build all of MuPDF from source under Windows, using the VS solution. It 'seems to' work14:21.35 
  For me, suing that code, the suggested mutool clean -gg -s -z u.pdf results in a file whcih is only marginally smaller (745 Kb) but still contains the content.14:24.00 
  Ah, he's using 1.9, let me try that.14:24.40 
TyrfingMjolnir How can I combine 2 facing pages into 1 page?15:14.42 
  I would like to combine page 8 + 1 , 2 + 3, 4 + 5, 6 + 715:15.21 
kens That's called imposition15:15.42 
  What is the input format ?15:16.15 
TyrfingMjolnir PDF15:18.02 
  input and output are both PDF15:18.22 
kens Well, you would need to do significant amounts of PostScritp scripting to use Ghostscript. You *might* be able to use MuPDF but I can't help you with that. If you search for 'PDF iposition' with Google you will get a number of results15:18.53 
  PDF imposition that is15:19.07 
TyrfingMjolnir The problem with this is that it's in a strangeformat15:20.01 
  impositioning to A5 or A5 will make a mess15:20.20 
kens Why ?15:20.33 
TyrfingMjolnir White border 15:20.40 
  I already tried on Mac with Preview15:20.53 
  margins15:21.03 
kens Well you can also crop PDF files15:21.06 
TyrfingMjolnir Exactly15:21.18 
kens You probably need to crop the white space then impose15:21.18 
TyrfingMjolnir I'm not interested in any cropping15:21.26 
kens Well, that's two steps15:21.31 
  So what do you want, if you don't want to crop off the white space ?15:21.59 
TyrfingMjolnir The white space is not there unless conforming to a papersize15:22.02 
kens Well obviously15:22.23 
  If the PDF is not the size of a standard sheet of a given media15:22.35 
TyrfingMjolnir If going 1:1 of source PDF fits perfectly15:22.40 
kens #Then there will be white space when you print it to a given media size15:22.48 
  No still not understanding your point15:22.59 
  If the PDF is not the size of the media, then there will eb white space around it. If it is the size of the media, there will be no white space.15:23.37 
  In either case you should be able to impose multiple sheets without a problem15:23.56 
TyrfingMjolnir imposing without facing heads should be quite easy, no?15:26.11 
  facing heads is more complicated: https://en.wikipedia.org/wiki/Imposition15:26.27 
kens There are multiple different kinds of imposition, I thought you just wanted N-up, not full signatures15:27.07 
TyrfingMjolnir How can I combine PDF page 2 and 3?15:27.49 
kens If you want a full signature, possibly including offset angles for paper folds, you will need professional grade software15:28.00 
TyrfingMjolnir By placing them next to each other on the same output double the width of size of 1 input page?15:28.30 
kens OK so that's what is normally described as 2-up which is a special case of n-up15:29.03 
  Its still imposition, its just a simple case15:29.17 
TyrfingMjolnir I dropped out15:30.02 
kens Ah, thought I'd scared you off :-)15:30.06 
  So 2-up is about the simplest case there is15:30.17 
  Any simple imposition software should let you do that.15:30.33 
TyrfingMjolnir No just some idiot PMing med about #pizzagate15:30.40 
  But using gs?15:30.52 
  Preview on a mac does this, but wrongly15:31.07 
kens Well, you could use Ghostscript, but its not really designed for the task, especially not with PDF input.15:31.16 
  Yeha I don't understand why you are having trouble with using Preview15:31.34 
TyrfingMjolnir how?15:31.37 
  It works on screen15:32.00 
kens Umm, what works on screen ?15:32.18 
TyrfingMjolnir But I have not find any way for preview to export the spread as PDF15:32.20 
kens Ghostscript, preview ?15:32.24 
TyrfingMjolnir 2-up15:32.32 
kens Ah I see, Preview won't export as PDF15:32.36 
  I wasn't aware of that15:32.41 
TyrfingMjolnir No Apple Preview.app15:32.42 
kens OK here's a Stack Overflow answer I wrote some time back it may help :15:33.30 
  http://stackoverflow.com/questions/30545382/ghostscript-for-pdf-how-to-fit-4-pages-into-1/30546987#3054698715:33.30 
TyrfingMjolnir Perhaps better use poppler to pick it apart and then mount each page in photoshop15:33.32 
  And if I would like to mount 2 JPGs together?15:35.33 
  next to eachother15:35.38 
kens I'd advise you to use an image manipulation package, if you have Photoshop use that15:35.59 
TyrfingMjolnir I can 2 that for 2 pages15:36.15 
  I can do that for 2 pages; but not 30015:36.33 
kens Ghostscript doesn't process JPEG directly, it only handles PostScript and PDF. There are PostScript utility programs (readJPEG.ps in the lib folder) which will read JPEG, but they would need more work in order to do 2-up, the code assumes one image per page at present15:38.04 
  Sorry thatr should be viewJPEG.ps, not readJPEG.ps15:38.22 
  If you are good with writing PostScript you could modify that code in order to do JPEG 2-up15:39.00 
ray_laptop TyrfingMjolnir: you may want to look around for "imposition" packages for doing n-up15:50.07 
kens ray_laptop : I did suggest that15:50.42 
yousef ray_pc: yes, you answered my question perfectly. ideally i wanted to create a fast, self-contained utility that generates thumbnails for pdf pages in a pdf file (without having a big dependency like ghostscript or imagemagick), but i don't have the required background in the pdf specs etc to do this19:57.29 
  ray_pc: so i guess linking against ghostscript is my best option19:57.42 
ray_laptop yousef: rendering a PDF to an image is pretty hard in the general case, so ghostscript, mupdf, acrobat, or others is needed20:03.24 
Leftmost I am using gs to take an input PDF and output per-page PDFs. Is it possible to preserve somewhere (e.g., in the first output page) information such as table of contents?22:31.05 
 Forward 1 day (to 2016/12/07)>>> 
ghostscript.com
Search: