IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2014/01/10)2014/01/11 
Noldorin can postscript do basic string parsing?01:35.11 
Robin_Watts Noldorin: postscript can do most things - it's just a question of how hard you want to work.01:42.51 
Noldorin Robin_Watts. yeah. i'm just reading through the cookbook at the moment, and pondering how hard it might be, that's all :)01:43.19 
  aha01:54.23 
  the array ops also work on strings01:54.29 
  very good01:54.30 
  Robin_Watts, any idea how to push a literal onto the stack?02:16.16 
  i mean02:16.22 
  a literal constructed from some string, say02:16.31 
  bah02:23.54 
  no-one here now :(02:23.58 
mobjax Hi13:22.02 
ghostbot que tal, mobjax13:22.02 
mobjax good Morning13:22.09 
  I succesfully installed MuPDF for one of my Android Apps13:22.23 
  But the problems is,13:22.35 
  I cannot fit the PDF to the screen13:22.53 
  can anybody suggest me how to achieve this13:23.05 
jo0nas mobjax: Don't contact me discretely, that's bad behaviour on IRC!13:33.01 
  mobjax: do *NOT*^contact me directly!!!13:37.51 
mobjax ok13:38.05 
  then how can I contact you13:38.08 
jo0nas I have no interest in talking with you now13:38.26 
mobjax ok13:38.36 
  Thanks13:38.39 
jo0nas good luck - be nice and there's a higher chance folks want to help you13:39.17 
mobjax Thanks Again!13:39.47 
Robin_Watts mobjax: Hi. irc has time lags; be prepared to wait around for a while for answers.14:03.32 
  In particular, over weekends here, it's slower.14:03.43 
  So, you have build MuPDF into your android app. Is this a commercial app, or a GPL one?14:03.59 
mobjax it is a GPL one14:04.34 
  thanks that somebody answered at last14:05.09 
Robin_Watts Ok. So are you just taking our example android viewer and hacking on that?14:05.13 
  Or are you writing at the C API level ?14:05.26 
mobjax i built the entire library using Cigwin and all14:05.38 
  and am able to render the PDF14:05.43 
  on Android14:05.48 
  but it gets displayed in the middle of the screen14:05.59 
Robin_Watts But are you coding in C or in java?14:06.06 
mobjax in Java14:06.18 
  What i want is, i have a layout and I want to show the PDF inside it14:06.39 
  and it should fill the layout14:06.47 
Robin_Watts Ok. The published API for the MuPDF is the C level one.14:06.47 
mobjax that is correct14:06.57 
  but by using CigWyn and Android NDK14:07.09 
  i converted the native one to a library and using it inside my Android project14:07.27 
Robin_Watts In order to make the C level API accessible from java, we have had to wrap it in some JNI code and expose that through various java classes.14:07.59 
mobjax yes14:08.07 
  that is what i did14:08.11 
  and I am able to do that14:08.22 
Robin_Watts When I first did the Android build, I didn't expose all the entrypoints. I wrapped up just enough for what I needed.14:08.33 
mobjax but i am stuck on, scaling the PDF to the screen14:08.35 
  ohh14:08.47 
Robin_Watts And paulgardiner has now taken over from me on the android app. He's exposed some more stuff, but it's not a general purpose solution.14:09.16 
  Consequently, the android app as it is now has been built specifically to cope with displaying things in the way we need for our app; pages are spread out horizontally, and you can flip through them.14:09.56 
  If you're trying to make MuPDF layout it's rendered pages differently that will require some significant changes to the java.14:10.23 
mobjax yes14:11.10 
  rendering I am able to achieve, horizontal thought14:11.23 
  but i want the pages to be fit the screen resolution14:11.35 
Robin_Watts I have been working on exposing the MuPDF C API through java in a more natural way - a way which will allow java programmers to open files/load pages/draw pages with full control of size/position/scale etc.14:11.40 
mobjax ohh14:11.53 
  can you share some thoughts14:12.00 
  so that we also can do the same here14:12.06 
Robin_Watts While this code is close to the point where someone could try it out, it will most probably not work first time, and will need some tweaking as we get it working.14:12.19 
  The latest version of this work is here: http://git.ghostscript.com/?p=user/robin/mupdf.git;a=shortlog;h=refs/heads/jni14:12.55 
  but I can't offer you a trivial "if you change this bit here, you can set the scale for the pages" answer.14:13.48 
mobjax ohh ok14:14.50 
  u want me to try this now?14:14.57 
Robin_Watts If you come back on monday morning, you may be able to speak to paulgardiner, who is more up on the java side of things than me.14:15.24 
  Have you read platform/android/ClassStructure.txt ?14:15.56 
mobjax ok14:16.17 
  I will try with the link that you provided14:16.26 
  if I am unable to crack it, I will speak to Paul on Monday as you suggested,14:16.49 
  yes,14:16.53 
  after reading it only, I understood that I need to change some values in MuPDFCore.Java14:17.17 
  to achive the full sized rendering of the PDF14:17.27 
Robin_Watts ok. Making use of the code at the link I provided will require you to rework a significant amount of work.14:17.34 
  mobjax: Are you calling MuPDFCore yourself ?14:17.44 
mobjax coz it is in native14:17.50 
  no,14:17.52 
Robin_Watts or are you using the existing class structure?14:17.58 
mobjax it is done automatically whenever I select any PDF14:18.06 
Robin_Watts So you're still using MuPDFReaderView etc ?14:18.29 
mobjax yes14:19.05 
Robin_Watts so you don't want to fiddle with MuPDFCore itself. You want to fiddle with how the classes built upon it call it.14:22.35 
mobjax yes14:32.49 
  that would be more easy for me14:32.57 
Robin_Watts Right, so it's paul you need to talk to.14:33.08 
mobjax ohh ok14:33.14 
  then I will wait till monday and talk to him14:33.22 
  thanks for your time and effort14:33.33 
  btw, where are u from >14:33.38 
Robin_Watts Both Paul and I are in the UK.14:33.47 
mobjax ohh14:34.15 
  I am from India14:34.18 
ray_laptop Noldorin: I'm here if you still have PS questions17:44.14 
Noldorin ray_laptop, thank you. as it happens i've solved it now though, and taught myself the rudiments of postscript in the process. :)17:44.52 
  i feel comfortable around PS now at least17:44.57 
ray_laptop Noldorin: great. Always nice to have more PS hackers in the mix17:45.33 
Noldorin :)17:45.45 
ray_laptop I saw you were looking for string parsing. search anchorsearch and token are the handy ones. Ghostscript also has concatstrings that was missing from PS17:47.21 
  Also, for debugging, 'pstack' is your friend17:48.22 
Noldorin ray_laptop, ah interesting. so token is like an 'eval' for PS?18:10.29 
ray_laptop Noldorin: token just gets the next delimitted element. It doesn't 'exec' it18:11.51 
Noldorin ray_laptop, element? doesn't it get all the tokens in a given string?18:12.13 
ray_laptop Noldorin: and it isn't flexible as far as token delmitters -- it does match PS rules: whitespace, of course, but also ( and { and other things are self delimiting tokens).18:13.30 
  Noldorin: token only returns the next token (actually it returns a boolean to tell you whether or not it got a token, then the token, then the rest of the string)18:15.13 
Noldorin ray_laptop, ah k. got it18:15.26 
ray_laptop so only one token at a time18:15.27 
Noldorin ray_laptop, and you execute it just by popping it off the stack?18:16.08 
ray_laptop Noldorin: no, if you pop it, you discard it. To execute it, you use 'exec'18:16.43 
Noldorin ray_laptop, oh, so it's a procedure huh?18:16.55 
ray_laptop Noldorin: no, you aren't guaranteed that it's executable. Most often it's a literal, and exec of a literal just pushes itself on the stack18:18.28 
Noldorin ray_laptop, but what if it's a normal token...?18:19.43 
ray_laptop Noldorin: don't know what you mean by 'normal token'18:20.08 
Noldorin well, a normal token18:20.15 
  like exch18:20.18 
  pop18:20.19 
  roll18:20.21 
  etc18:20.23 
  not a literal or number :P18:20.26 
  or procedure18:20.30 
ray_laptop Noldorin: those are operators, and no different to procedure names18:21.09 
Noldorin k18:21.15 
ray_laptop if it isn't a literal, it is looks it up in the dictstack and if it finds it, it will exec it.18:22.02 
  otherwise 'undefined' error18:22.42 
  Noldorin: sorry -- phone call... bbiab18:23.32 
 Forward 1 day (to 2014/01/12)>>> 
ghostscript.com
Search: