[MacRuby-devel] PDFKit status?

Matt Aimonetti mattaimonetti at gmail.com
Sun Dec 5 16:47:32 PST 2010


Can you please file a ticket (find the info on the website) and maybe try to reduce the problem to a few lines of code?

Thanks,

- Matt

Sent from my iPhone

On Dec 5, 2010, at 16:27, Yasu Imao <yimao.ml at gmail.com> wrote:

> Hi,
> 
> I'm wondering what the status of using PDFKit in MacRuby.  Should it be fully usable now?  I encountered a possible bug.  
> 
> 
> framework 'cocoa'
> framework 'Quartz'
> 
> path = <whatever the path to a pdf file>
> 
> pdfDoc = PDFDocument.alloc.initWithURL(NSURL.fileURLWithPath(path))
> selections = pdfDoc.findString("the",withOptions:NSCaseInsensitiveSearch)
> selections.each do |selection|
>  p selection.string
> end
> 
> => NSInvalidArgumentException: -[CPCharacterIndex count]: unrecognized selector sent to instance 0x200915a80 (RuntimeError Error)
> 
> 
> The PDF I used is an academic journal article PDF with about 12000 words.  This occurred at different positions in the PDF file every time.  Sometimes this happens earlier in the loop and sometimes later.  This did run a few times without error (rarely, though).  Whether or not to add .string didn't matter.  The same process works without any problem with RubyCocoa.
> 
> 
> Best,
> Yasu
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


More information about the MacRuby-devel mailing list