IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2015/11/22)20151123 
Nathaniel7687 hi Robin_Watts10:46.39 
Robin_Watts Nathaniel7687: Hi.11:01.22 
  Nathaniel7687: You were the guy who was having trouble with openBuffer on MuPDF, right?11:07.35 
Nathaniel7687 right11:12.14 
  and I find one more problem...11:12.37 
Robin_Watts Can you try opening a file using openBuffer, then quickly skip pages so that it crashes, and then give me a pastebin of the logcat output please?11:12.55 
Nathaniel7687 maybe this problem is only my app...11:13.03 
  right now ?11:13.23 
Robin_Watts Whenever is convenient.11:13.34 
Nathaniel7687 okay~11:13.58 
  how can i get current page number?12:28.09 
Robin_Watts mDocView.getDisplayedViewIndex()12:33.11 
Nathaniel7687 thank you ~12:36.06 
mrev1l hi everyone!12:40.17 
Nathaniel7687 how can I avoid blur phenomenon when I touch the screen?12:40.31 
  hi mrev1l12:40.35 
mrev1l may i ask for a bit of guidance? i'm trying to fill annot->obj dictionary in order to create ellipse annotation, due to this spec: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf . But i'm having an issue with understanding of how to initialise pdf_obj as such and annotation dictionary in paricular?12:44.05 
  please find TABLE 8.15 Entries common to all annotation dictionaries on page 60612:44.35 
  i'm trying to do that via c++12:50.27 
Robin_Watts mrev11: Were you here last week?12:51.22 
mrev1l +Robin_Watts: yes, i was. and i understood, that my problems start at a lower level, than i thought initially.12:57.17 
Robin_Watts mrev1l: Annotations are a pain in PDF.12:57.40 
  Essentially PDF readers fall into 2 camps.12:57.58 
  Actually, make that 4 camps.12:58.18 
  1) PDF readers that ignore annotations and never do anything with them.12:58.34 
  2) PDF readers that will render the appearance streams for annotations they find in the file.12:58.56 
  3) PDF readers that ignore the appearance streams for annotations they find in the file, and always synthesise them from the data on loading.12:59.42 
  4) PDF readers that will render the appearance stream if there is one, but will synthesise them from the data if there is not.13:00.26 
  So to keep them all happy you have to both generate an appearance stream *AND* make sure the data is there so that they can be resynthesised on loading.13:01.05 
  I believe modern acrobat versions are 3).13:01.18 
  So the very first thing you should do is to figure out exactly what data acrobat needs to be happy with the ellipse annotation dict.13:03.46 
  You could do that by generating an annotation on a simple PDF file and saving it out from acrobat.13:04.08 
  Then run: mutool clean -difggg in.pdf out.pdf and look at the file to see what there is there.13:04.40 
mrev1l right, ty.13:08.55 
tor8 mrev1l: I personally find "mutool clean -dagg" to be more accessible, but the options are there for everyone to get what they like best :)13:09.59 
  -d for decompress so you can edit, -g to throw away unused objects so you get a minimal file (the extra 'g's just tell it to be more aggressive in pruning)13:10.55 
Nathaniel7687 How can I get the Information about bookmark what is affiliated with current page?13:11.06 
tor8 with -a you'll get a plain ascii PDF file which can be edited and viewed in most any editor13:11.14 
Nathaniel7687 How can I get the Information about bookmark what is affiliated with current page~?13:21.01 
mrev1l trying to execute mutool clean i've got an error cannot open in.pdf; error cannot loaddocument in.pdf13:22.25 
Robin_Watts mrev1l: in.pdf = the input pdf name.13:22.44 
mrev1l this is a file that is create within my app; works fine with the others; yes, i doublechecked file name)13:23.14 
  is created*13:23.22 
Robin_Watts What other information is given?13:23.53 
mrev1l http://my.jetscreenshot.com/demo/20151123-ekin-18kb 13:25.10 
  this is the proper filename13:25.56 
Robin_Watts Well, either the file doesn't exist, or it's open elsewhere, or there is some sort of permissions problem.13:26.37 
  Have you considered trying it in a less bonkers directory?13:26.56 
kens copy t.pdf to test.pdf and try again13:27.00 
mrev1l kens: that was the initial file name) 13:27.26 
  Robin_Watts: give me a skinny minute13:27.39 
kens Then I'm with Robin13:27.44 
  copy it to a sensible locatoin and try from there13:27.52 
mrev1l yep. it worked13:29.28 
tor8 mrev1l: in source/stream-open.c line 145-ish try changing the fz_throw to fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open %s: %s", name, strerror(errno));13:29.29 
Nathaniel7687 I would like to know if the page is what belonged to bookmarks.13:40.49 
kens Bookmarks are not 'associated' with a page. Bookamrks (The Outlines tree) is stored separately in the PDF file. If you want to know which bookmarks (ifg any) arre associated with teh current page you will have to walk the Outliens tree looking for Dests which involve the current page number. Or so I believe.13:42.10 
mrev1l may i ask you, what mutool clean actually does? because i tried passing it different files, created in different software and it seem to have made no effect 13:42.51 
Nathaniel7687 just I can do compare mDocView.getDisplayedViewIndex() with page of OutlineActivityData.get().items?13:42.57 
kens Nathaniel7687 : I have no idea13:43.08 
Robin_Watts mrev1l: mutool clean reads in the file, then outputs it again.13:43.26 
kens I know very little about MuPDF, and less about Java13:43.28 
tor8 mrev1l: mutool clean rewrites the file. it parses it, and writes it back out. think of it as a syntax pretty printer.13:43.34 
  it can also do a few minor transforms, like decompressing data, and deleting pages and the objects that those pages refer to13:44.11 
Nathaniel7687 thank you kens ~13:44.12 
Robin_Watts Nathaniel7687: I suspect so, yes.13:44.42 
kens chrisl ping14:27.32 
chrisl kens: pong14:27.45 
kens Can you spare me a few minutes to talk about a GC 'problem' (its not exactly GC, but....)14:28.17 
chrisl Yeh, go ahead14:28.46 
kens Lets do it private, no reason to fillup the logs :-)14:29.00 
chrisl Fine14:29.13 
HenryStiles chrisl: you're in demand today, can you review my gslibctx stuff? I'd like to get that to master/origin and not have it part of my language switch branch.14:42.20 
chrisl HenryStiles: Sure, let me grab a coffee, and then I'll look it over14:43.39 
HenryStiles chrisl: no hurry14:43.51 
chrisl HenryStiles: the code looks fine - very minor quibble (and not your fault at all): I'd prefer if the comment didn't use 'assert' when we're not using assert() but returning an error......14:53.48 
HenryStiles chrisl: thanks agreed I'll take that out. I sort of feel it should be a real assert but let's move on and not bring up that stuff.14:57.53 
chrisl We could either make it an assert, or use a "real" error rather than -114:59.41 
HenryStiles yeah I'll make it gs_error_Fatal15:00.46 
chrisl HenryStiles: There's a couple of other error conditions in there that could do with tidying up, too - since one of them is mine, I don't mind if you want to leave that to me15:04.56 
HenryStiles chrisl: I just fixed your client names if that's what you mean...15:05.28 
chrisl HenryStiles: that was one, there's a couple of others where we just return -1 rather than a meaningful error15:06.13 
mrev1l guys, is this a correct way to set value? pdf_dict_puts_drop(annot->obj, "BS", pdf_new_obj_from_str(pdfDoc,"<< /BS << /W 3 >> >>"));15:06.47 
HenryStiles chrisl: oh I will leave that to you. I'd like to use the "throw" error stuff too, but I usually forget to do it.15:07.10 
chrisl HenryStiles: I'm not keen on the gs_throw() stuff - to me, it sort of implies something cleverer than what it is.....15:09.30 
HenryStiles chrisl: well if not that something that gives us -Z# is useful to me, I know that's useless for ghostscript for the most part but I use it a lot with the languages.15:11.22 
chrisl HenryStiles: I think it's more the "throw/catch" terminology that grates for me, than the actual function of the code15:12.30 
HenryStiles chrisl: yes implies exception handling and there isn't any15:13.06 
  chrisl: maybe fix the coverity warning about derefencing NULL profiledir I'm sure if the length is greater than 0 it's okay but simple enough to check both the pointer in not NULL and the length is not zeor15:25.47 
chrisl HenryStiles: Yes, I've fixed a couple of similar coverity warnings elsewhere15:27.09 
tor8 chrisl: HenryStiles: that gs_catch/throw stuff comes from gxps using the same (before we added exceptions) fitz error code return functions16:40.30 
  feel free to rename the lot to something less confusing16:41.00 
Nathaniel7687 How can I get the number of array of "OutlineItem mItems[ ]"19:33.53 
Robin_Watts That's a java programming question, right?19:39.13 
  If you've got an array X, you just find it's length by doing X.length19:40.00 
Nathaniel7687 yes19:40.06 
  ah... I'm stupid... 19:40.46 
  thanks;;19:40.49 
  mItems.length is crashed19:44.01 
  Error: java.lang.NullPointerException: Attempt to get length of null array19:44.23 
Robin_Watts Right, so if mItems is null, there are no outlines in that file.19:44.44 
Nathaniel7687 so, how can I get the number of outlines?19:45.20 
  http://codeshare.io/T9sLQ is also appear NullPointerException.19:50.21 
Robin_Watts if there are no outlines, the number of outlines is 0.19:51.20 
  What do you expect that code to do?19:52.16 
Nathaniel7687 I want to get the number of bookmakrs(outlines).19:52.38 
Robin_Watts OutlineItem mItems[] = OutlineActivityData.get().items;19:53.14 
  int numOutlines = (mItems == null) ? 0 : mItems.length;19:53.30 
Nathaniel7687 why numOutlines is 0...19:55.31 
  :(19:55.41 
Robin_Watts because there are no outlines in that file?19:55.55 
Nathaniel7687 I can see this file have more than 300 outlines in MuPDF application.19:56.59 
  I can get numOutlines in "public View getView(int position, View convertView, ViewGroup parent)"19:58.29 
  what's different?19:58.39 
  getView function is in OutlineAdapter.java19:59.22 
Robin_Watts I don't think you're getting what you think you're getting.20:14.39 
  In MuPDFActivity we call core.hasOutline() to see if there are any outlines.20:15.08 
  If there are, we get those using core.getOutline() and we put them into the OutlineActivityData object.20:17.34 
  The OutlineActivity that is kicked off takes the OutlineActivityData object as input.20:17.57 
  So we only actually fetch the outline data once the mOutlineButton in the UI is clicked.20:19.24 
  See MuPDFActivity.java arund line 631 starting if (core.hasOutline())20:20.16 
  I'm guessing that you need to copy the contents of the onClick function there to just before you start fiddling.20:20.58 
Nathaniel7687 hm... see this source http://codeshare.io/T9sLQ20:20.58 
  see you that?20:23.37 
Robin_Watts Nathaniel7687: Nowhere in there are you actually calling core.getOutline().20:24.25 
  I have to go for the night.20:24.30 
Nathaniel7687 okay~20:24.57 
  thanks 20:24.59 
Robin_Watts Look at the code around line 634 in MuPDFActivity.java in the 'onClick' function inside the if (core.hasOutline())20:25.01 
Nathaniel7687 have a good night20:25.02 
Robin_Watts You too.20:25.06 
Nathaniel7687 okay20:25.14 
 Forward 1 day (to 2015/11/24)>>> 
ghostscript.com
Search: