| <<<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 |
| *debian | 09:46.46 |
malc_ | diwakar: are you using submodules? | 09:48.32 |
diwakar | yes it's cloned from the git repository and I'm using submodules | 09: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 command | 09:50.38 |
| malc_: yes | 09:50.44 |
malc_ | diwakar: is $mupdf/thirdparty/ populated? | 09:51.55 |
diwakar | malc_: yes it is | 09:53.12 |
malc_ | diwakar: followed thirdparty/README ? | 09:54.11 |
diwakar | malc_: yes I did "git submodule update --init" after cloning | 09:55.16 |
malc_ | diwakar: then I can only suggest waiting for artifex dudes to answer you | 09: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 today | 10: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 files | 10:10.53 |
kens | Hmm, well that ought to be sufficient | 10: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.git | 10:14.09 |
kens | OK I'm just cloning that now, give me a minute | 10:14.22 |
| Not on Debian mind.... | 10:14.39 |
diwakar | kens: which one | 10:15.38 |
kens | I'm using Fedora | 10:15.48 |
diwakar | kens: ok | 10:15.53 |
kens | Well, I get a completely different problem | 10:18.48 |
| Seems harfbuzz requires a C++ compiler/linker or something | 10:19.02 |
diwakar | what is harfbuzz? | 10:20.03 |
kens | Its a text thing | 10: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 it | 10:21.03 |
| malc_ : Yes I know | 10:21.12 |
| I'm trying to sort out gcc now | 10:21.26 |
malc_ | kens: "or something" tripped me off | 10:21.33 |
kens | I'm a bit surprised MuPDF includes this since I thought Tor was against C++ | 10:21.43 |
malc_ | he is | 10:22.03 |
| but my suggestion to use m17n didn't sit well with him for whatever reason | 10:22.20 |
| and it's not like harfbuzz needs boost or something | 10:22.32 |
| and given that all the C compilers these days (gcc included) are written in C++ the point becomes moot | 10:22.50 |
kens | Well, my gcc won't compile harfbuzz | 10:23.50 |
malc_ | very strange | 10:25.27 |
kens | Lets see if this will work.... | 10:25.57 |
| 40MB download... | 10:26.05 |
| OK sems like that fixed gcc | 10:28.07 |
| and jpeg builds fine for me | 10:28.34 |
| GL doesn't, but that's because I don't have the right dependencies installed | 10:28.55 |
kens | builds again with HAVE_GLFW=no | 10:30.29 |
| Well, the build works OK for me | 10:33.01 |
diwakar | is the problem debian then | 10:34.03 |
kens | I'm not enough of a Linux guru to know I'm afraid | 10:34.19 |
diwakar | It doesn't need any shared libraries installed does it when I'm using submodules | 10: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 availabale | 10: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 comment | 10: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 hours | 10:37.17 |
| Its currently 05:37 am where they are | 10:37.33 |
diwakar | Was mupdf api changed recently mainly the function 'fz_get_pixmap_from_image' | 11:02.44 |
kens | The API changes fairly frequently | 11:08.15 |
diwakar | so I noticed | 11:11.27 |
| I cloned the repository and did all the things from the start. Now it's building without any errors. Thanks guys | 11: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 -ggg | 11: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 mean | 13: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 help | 13: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 look | 13: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.O | 13: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 much | 13:15.07 |
kens | Well, the illustrator document *is* referenced, its down as /Private in the /Illustrator dictionary referenced from the Page dictionary | 13: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 me | 13:16.34 |
| Ghostscript drops the file to 2Kb | 13:17.26 |
halabund | Ah, sorry, I actually used this full command line: | 13:17.27 |
| mutool clean -s -z u.pdf | 13: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 afraid | 13: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 images | 13:18.40 |
| -z flate compresses the data, I suspect that dropping the object is probably co-incidental, and probably not intended | 13:19.11 |
halabund | You mean a bug? :) | 13:19.22 |
kens | Well, possibly :) | 13:19.37 |
| I don't know enough to be sure | 13: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 decide | 13:20.39 |
halabund | OK, then mentioning here was good enough | 13:20.59 |
| Thanks for the help! | 13:21.04 |
kens | NP | 13:21.07 |
tor8 | halabund: the -s option to mutool clean will rewrite the graphics command stream, and may (but should not) cause graphics changes | 13: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 investigate | 13:28.18 |
chrisl_x250 | Dropping the embedded Illustrator file seems like a good feature to have for mutool | 13:28.43 |
tor8 | halabund: mutool clean -gg -s -z is a good set of options for reducing size and cleaning up invalid but parsable stuff | 13: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 way | 13:29.49 |
| chrisl_x250: have you had breakfast yet? | 13:30.29 |
chrisl_x250 | tor8: no | 13:30.42 |
tor8 | I'm waiting for sebras to show up on IRC, but if not the plan is to head down at 9 | 13:30.57 |
| if you want to join us | 13:31.09 |
chrisl_x250 | Yeh, that sounds good | 13:31.22 |
| Thanks | 13:31.25 |
| tor8: I suspect sebras might be enjoying some extra sleep time - we were all pretty tired when we got back last night | 13: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 again | 13: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 that | 13: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 lunch | 13: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 bighty | 13:56.57 |
| A few of us came away with nipped fingers | 13:57.13 |
| Anyway, heading down for breaky | 13: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 elevators | 13:58.05 |
tor8 | or meet at sebras' door, 6124 | 13:58.10 |
chrisl_x250 | Okay | 13: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 directory | 14:08.42 |
| when building thirdparty.lib and of course after that everything goes to pieces | 14:08.42 |
| Note that there is no thread.c in the openjp2 directory | 14:09.43 |
| Removing thread.c from the solution gets me past that, then I get an unresolved external on js_newobjectx refrenced in murun_main | 14: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' work | 14: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 + 7 | 15:15.21 |
kens | That's called imposition | 15:15.42 |
| What is the input format ? | 15:16.15 |
TyrfingMjolnir | PDF | 15:18.02 |
| input and output are both PDF | 15: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 results | 15:18.53 |
| PDF imposition that is | 15:19.07 |
TyrfingMjolnir | The problem with this is that it's in a strangeformat | 15:20.01 |
| impositioning to A5 or A5 will make a mess | 15:20.20 |
kens | Why ? | 15:20.33 |
TyrfingMjolnir | White border | 15:20.40 |
| I already tried on Mac with Preview | 15:20.53 |
| margins | 15:21.03 |
kens | Well you can also crop PDF files | 15:21.06 |
TyrfingMjolnir | Exactly | 15:21.18 |
kens | You probably need to crop the white space then impose | 15:21.18 |
TyrfingMjolnir | I'm not interested in any cropping | 15:21.26 |
kens | Well, that's two steps | 15: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 papersize | 15:22.02 |
kens | Well obviously | 15:22.23 |
| If the PDF is not the size of a standard sheet of a given media | 15:22.35 |
TyrfingMjolnir | If going 1:1 of source PDF fits perfectly | 15:22.40 |
kens | #Then there will be white space when you print it to a given media size | 15:22.48 |
| No still not understanding your point | 15: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 problem | 15: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/Imposition | 15:26.27 |
kens | There are multiple different kinds of imposition, I thought you just wanted N-up, not full signatures | 15: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 software | 15: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-up | 15:29.03 |
| Its still imposition, its just a simple case | 15:29.17 |
TyrfingMjolnir | I dropped out | 15:30.02 |
kens | Ah, thought I'd scared you off :-) | 15:30.06 |
| So 2-up is about the simplest case there is | 15:30.17 |
| Any simple imposition software should let you do that. | 15:30.33 |
TyrfingMjolnir | No just some idiot PMing med about #pizzagate | 15:30.40 |
| But using gs? | 15:30.52 |
| Preview on a mac does this, but wrongly | 15: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 Preview | 15:31.34 |
TyrfingMjolnir | how? | 15:31.37 |
| It works on screen | 15: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 PDF | 15:32.20 |
kens | Ghostscript, preview ? | 15:32.24 |
TyrfingMjolnir | 2-up | 15:32.32 |
kens | Ah I see, Preview won't export as PDF | 15:32.36 |
| I wasn't aware of that | 15:32.41 |
TyrfingMjolnir | No Apple Preview.app | 15: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#30546987 | 15:33.30 |
TyrfingMjolnir | Perhaps better use poppler to pick it apart and then mount each page in photoshop | 15:33.32 |
| And if I would like to mount 2 JPGs together? | 15:35.33 |
| next to eachother | 15:35.38 |
kens | I'd advise you to use an image manipulation package, if you have Photoshop use that | 15:35.59 |
TyrfingMjolnir | I can 2 that for 2 pages | 15:36.15 |
| I can do that for 2 pages; but not 300 | 15: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 present | 15:38.04 |
| Sorry thatr should be viewJPEG.ps, not readJPEG.ps | 15:38.22 |
| If you are good with writing PostScript you could modify that code in order to do JPEG 2-up | 15:39.00 |
ray_laptop | TyrfingMjolnir: you may want to look around for "imposition" packages for doing n-up | 15:50.07 |
kens | ray_laptop : I did suggest that | 15: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 this | 19:57.29 |
| ray_pc: so i guess linking against ghostscript is my best option | 19: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 needed | 20: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)>>> | |