IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2013/09/05)2013/09/06 
tor8 evening00:03.21 
russcriptor hey guys, is there a way to have mudraw output to stdout?14:49.46 
robin_watts_mac russcriptor: output what?14:52.29 
russcriptor png14:52.38 
robin_watts_mac Urm... I don't think so, currently.14:52.58 
russcriptor i want to call mudraw from python and send it input and get output on stdout14:53.11 
  we're using gs for this currently, but I was told mudraw might be a better option14:54.23 
robin_watts_mac You can do it by calling from python to bash and calling into mudraw from there.14:55.00 
russcriptor what do you mean? I mean yea we're using the shell to call the command14:55.43 
  but I don't see options for piping to/from mudraw14:55.55 
robin_watts_mac bash can do named pipes.14:57.56 
russcriptor so I would need to create 2 pipes? One for input and one for output?15:00.52 
  and if I have multiple executions possibly happening at the same time, I would need to create/tear down the temp named pipes per execution?15:01.56 
tor8 robin_watts_mac: russcriptor: the input to mudraw needs to be seekable, so a temp file would be better than a named pipe (for input)15:02.14 
russcriptor hmm so that's why it doesn't support piping?15:02.54 
  would it be possible to add that option? It could read the whole file into memory or something15:03.31 
  like in puthon I would read it into a cStringIO.StringIO object15:04.06 
tor8 russcriptor: for pdf we need random access to the file, so yes, temp file is simplest. at the c level api, we can read files into memory and use that.15:04.08 
  there's also some support for "progressive" loading, but that's highly experimental and C level only15:04.30 
robin_watts_mac russcriptor: If you drive mupdf at the C level, you can do anything you want.15:04.36 
  But the mudraw exe is a simple (but comprehensive) example.15:04.51 
tor8 russcriptor: you can adapt docs/example.c to your own executable that does anything you want easily enough15:05.35 
sebras tor8: are there any other such simple examples that we ought to write to help people make use of mupdf?15:06.43 
robin_watts_mac It may be that with the new -F option, we can make it output to stdout easily.15:08.34 
russcriptor is there a python library?15:11.12 
  also what -F option15:11.31 
sebras russcriptor: -F is an option fo the mudraw binary.15:14.38 
russcriptor not according to this15:16.07 
  https://github.com/mariusmuja/mupdf/blob/master/apps/mudraw.c15:16.10 
sebras russcriptor: it is not present in the 1.3 release but exists in the git15:16.10 
  russcriptor: so you might have to update.15:16.49 
robin_watts_mac I'm working on making a stdout thing now.15:17.12 
tor8 russcriptor: that's not the official mupdf...15:17.35 
russcriptor hmm15:17.39 
tor8 http://git.ghostscript.com/?p=mupdf.git;a=summary15:18.11 
russcriptor I see...is there a reason you guys aren't on github?15:19.29 
robin_watts_mac russcriptor: We have our own public git setup, why would we use github?15:20.40 
russcriptor I don't know, I don't think I've ever seen another project that wasn't using github15:21.15 
sebras russcriptor: http://cgit.freedesktop.org/ there are a few more... ;)15:21.43 
  russcriptor: it is not uncommon that someone might fork it and update the fork over at github for sometime, but not being on github is not that unusual.15:22.32 
russcriptor I guess I'm just so used to everyone using github, especially since I believe they're free for Open Source projects15:26.11 
  and have nice web tools15:26.20 
  so if I build from git source15:26.33 
  what does the -F option do?15:26.47 
robin_watts_mac mudraw -F png -o - in.pdf15:32.59 
  The -F flag sets the format.15:33.14 
  Normally it gets the format from the suffix of the -o15:33.35 
  http://git.ghostscript.com/?p=user/robin/mupdf.git;a=commit;h=7e91f87c55e4910ab71852fdf9de424492f2d49315:34.18 
russcriptor I see you just added that option for me, thank you15:39.46 
  is there anything we can do to be able to pipe the PDF in?15:40.01 
sebras robin_watts_mac: that patch LGTM.15:43.07 
robin_watts_mac sebras: yes, tor8 ok'd it too.15:43.22 
  pushed to master, thanks.15:44.09 
sebras robin_watts_mac: better turnaround time when you guys are in the same room (or hotel at least).15:52.06 
robin_watts_mac sebras: yeah, sat next to one another :)16:43.28 
SIcos hi17:05.30 
ghostbot what's up17:05.30 
SIcos good evening17:05.34 
  I want to rotate pdf pages. I made a little postscript file where I run the pdf with the run command and tried to rotate page with <</Orientation 2>> setpagedevice17:06.56 
  But nothing happens.. does somebody know if it is possible to rotate pages this way?17:07.15 
  uhm ... seems everybody started the weekend already :-17:09.50 
  ))17:09.52 
robin_watts_mac SIcos: We are in a staff meeting at the moment17:10.25 
kens8463 And teh simple answer is 'you cna't do that' with pdfwrite17:10.42 
SIcos is there another way to do it?17:11.00 
  or do I need to use something like pdftk ?17:11.12 
kens8463 you need to rotate both the media and the contents, there is no provision for that in pdfwrite and there is no pdfmark defined for it.17:11.30 
  If you cna do ti with pdftk then you should do so17:11.40 
SIcos is it possible when i write some postscript code.. or is it just not possible?17:12.22 
kens8463 You 'could' write PostScript code, its not trivial17:12.48 
SIcos uhm17:12.57 
  any tips for me where to look... I can write postscript but I'm not a start in it17:13.16 
  start = star17:13.31 
kens8463 You would need to start by looking at ghostpdl/gs/Resource/Init/pdf_main.ps17:13.58 
SIcos btw what do you mean with not trivial?17:14.50 
  is there another way to do it?17:14.55 
kens8463 You need to discover where the PDF interpreter reads the MediaBox, and rotate thevalues, then use the rotate PostScript operator to modify the CTM correctly17:15.21 
  SIcos, no there is no other way with GS/pdfwrite17:15.33 
SIcos and what if I convert the pdf to ps with ghostscript and then back again from ps to pdf?17:16.08 
kens8463 You have the same problem, the only benefit is you can redefinie setpagedevice so that you can modify the /PageSize, and set a custom BeginPage to rotate the contents17:17.07 
SIcos uhm... both solutions look like a lott of work to me17:17.40 
kens8463 Note that conversion of PDF to level 2 PostScript will result in some objects being converted to images. This may include glyphs from CIDFonts17:17.47 
  SIcos, yes, not trivial like I said. GS+pdfwrite is not intended for this kind of task17:18.14 
SIcos uhm... I think I'm going to take the pdftk way... thanks for all the information17:18.46 
  to bad pdftk doesn't have an api to talk against17:19.33 
maktech are there any mupdf developers around?18:54.12 
sebras maktech: yes, a few. but most are held up by a company meeting. do ask your question though. :)18:57.51 
maktech thanks,18:58.27 
  I am attempting to render images created by mupdf on windows and the stream is RGBA 32 format. Windows supports a number of other pixel format but, not RGBA 32, BGRA 32 looks to be the closest I can get. I want to avoid having to read and then flip bytes. What pixel formats does MuPDf support?19:01.00 
robin_watts_mac maktech: fz_device_bgr19:02.00 
  use that instead of fz_device_rgb and you'll be fine.19:02.17 
maktech cool. does MuPdf produce an alpha channel?19:02.46 
robin_watts_mac It does.19:02.52 
  bgra.19:03.02 
maktech cool, thanks for the help. Appreciate it. 19:03.52 
paulgardiner robin_watts_mac: patch is up22:23.08 
robin_watts_mac Ta.22:23.15 
  looks good to me. push it at will :)22:23.53 
paulgardiner ta22:28.21 
 Forward 1 day (to 2013/09/07)>>> 
ghostscript.com
Search: