Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2016/12/19)20161220 
riccardo_ hello everyone, I have a problem with pdf_add_image(), maybe someone can help me09:10.01 
  I'm loading the image in this way: fz_image *image = fz_new_image_from_file(cox, filePath); pdf_obj *imgObj = pdf_add_image(ctx, idoc, image, 0);09:15.07 
  but I'm getting these errors: 09:15.44 
  error: object out of range (0 0 R); xref size 7509:15.45 
  error: cannot load object (0 0 R) into cache09:15.45 
  error: cannot initialize image resource table09:15.45 
kens You cannot use object number 0 in a PDF file, its defined as always unused, and is the head of the linked list of free objects09:16.45 
  Presumably MuPDF has a means to allocate a new object number for you, but I have no idea how to do that, you'll have to wait until one of the MuPDF developers comes online, which should be more or less any time09:17.41 
riccardo_ ok thanks, for reference this is the code: http://pastebin.com/Sy1reK3a09:18.10 
kens Yeah sorry but I don;t work on MuPDF, there should be someone who does within an hour or so though09:18.56 
Robin_Watts riccardo_: Just a mo.10:08.52 
riccardo_ yes, thank you10:10.16 
Robin_Watts I would *guess* that the problem is that pdf_add_image is expect image to be a reference rather than a pdf object.10:10.40 
  Try doing pdf_obj *imref = pdf_add_object(cox, doc, image); and then using imref rather than image in the pdf_add_image call.10:12.34 
riccardo_ robin: ok, I'll try. Just to be clear, it works most of the cases, it fail when the pdf that is being edited is generated from word and it already has some images in it.10:14.34 
Robin_Watts IF what I've suggested won't work, then I'll need a bug report with an example PDF, and a simple C program to show the problem.10:15.29 
riccardo_ robin: I'm trying right now, but pdf_add_image wants an fz_image* , not a pdf_obj*10:17.41 
Robin_Watts riccardo_: D'Oh.10:18.27 
tor8 riccardo_: that's right, pdf_add_image takes a fz_image, creates the pdf objects necessary to use said image in a PDF file, and returns an indirect reference pdf_obj10:18.55 
Robin_Watts riccardo_: Sorry, I'm still in need of caffiene.10:19.21 
riccardo_ robin: no problem :)10:19.57 
Robin_Watts I'm going to need that example file and a bug report then, please.10:20.13 
tor8 riccardo_: best example is in source/tools/pdfcreate.c function add_image_res10:20.17 
riccardo_ tor8: thanks10:23.37 
Robin_Watts riccardo_: Ah, you're still here.12:24.22 
  You say this is for the iphone... are you a commercial customer?12:24.37 
  If not, then you can't use MuPDF on an iphone. The AGPL license is not compatible with the Appstore terms and conditions.12:25.04 
  (apple Appstore, that is)12:25.15 
riccardo_ robin: Yes I'm trying it on an iPhone, but honestly because I found an example Podfile for using mupdf, I do not plan to release anything on the AppStore13:18.05 
  robin: I can run it on the mac and modify the bur report if you like13:19.03 
Robin_Watts riccardo_: That's fine. Free users are great. I just didn't want you to invest lots of time making an app based on MuPDF only to realise later that you couldn't release it.13:19.57 
riccardo_ robin: I'm writing a c program in linux to replicate the error, should I open a new report or modify the previous?14:15.35 
Robin_Watts modify the previous.14:15.45 
mupdfUser hi!21:40.00 
  In the Android version of mupdf there is a feature to display a hyperlinked list of sections of a PDF document. Can a corresponding feature be accessed in the X version?21:41.21 
  X windows, I mean.21:41.57 
  for linux.21:42.10 
 Forward 1 day (to 2016/12/21)>>> 
ghostscript.com
Search: