Arrsoya / jmupdf

Automatically exported from code.google.com/p/jmupdf
1 stars 0 forks source link

JPview is being ported to jMuPDF #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Dear Pedro et al.,

First of all thank you for some good code. I have been looking into the sources 
of jMuPDF the past days and I have decided to port the rendering engine of 
JPview, see evt. http://sourceforge.net/projects/jpview/, to use jMuPDF 
instead. The main object of JPview is to optimize on a scrolled canvas for PDF 
viewing on the java platform. Therefore I am very interrested in rendering 
speed. Hence I have created a little comparison of jPodRenderer vs jMuPDF (SWT, 
i have written support for SWT images) to be found here 
http://sourceforge.net/projects/mujp/. In short, the test render into pixels, 
the a SWT image is created and disposed, thats all. Since, SWT images are also 
handled through dll-handles, they are a little faster than BufferedImages and 
does not consume same amounts of memory. I guess we can agree on that. 

As I see it, it is currently not possible to recieve characters with positions 
from jMuPDF as text is extracted as lines with a starting position. Did I 
understand this correctly? Will your library support this in the future or will 
I have to rework and rebuild dll's myself?

Do you plan to include SWT Image support in the library or will I have to 
create a port of my own? It is nothing but 15 lines of code that I can send you 
if interested?

I am very eager about doing a small and FAST pdf viewer for the java platform 
and I have already decided to go the MuPDF/SWT way. Will you join forces? :-)

Please contact me on mail morling.peter@gmail.com if any interest :)

Thanks,

Best regards,

Peter :-)

Original issue reported on code.google.com by morling....@gmail.com on 7 May 2014 at 4:29

GoogleCodeExporter commented 9 years ago
Dear Pedro et al.,

I have made a terrible mistake in my experiments. I was comparing jMu on scale 
2.0 vs jPod on scale 4.0. I am so sorry for the fuzz. I'll decided to wait time 
and follow you project with great interest. If you will decide on SWT here is 
the code to create a SWT image, more or less the same as for Swing:

// in PagePixelsImpl 

PageRect bb = getOptions().getBoundBox();
PaletteData palette = new PaletteData(0xFF0000, 0x00FF00, 0x0000FF);
ImageData imageData = new ImageData(bb.getWidth(),bb.getHeight(),24,palette);
// byte buf 
imageData.setPixels(0, 0, bb.getWidth()*bb.getHeight(),(byte[]) pixels, 0); 
// int buf
imageData.setPixels(0, 0, bb.getWidth()*bb.getHeight(),(int[]) pixels, 0);
image = new Image(Display.getDefault(), imageData);

Shit happens :-)

Best, Peter

Original comment by morling....@gmail.com on 8 May 2014 at 6:54

GoogleCodeExporter commented 9 years ago
You code have a small error. If the pixels data are an array of bytes, then the 
image data depth must be set to 8 at the maximum. The code will be:
<pre>
if (pixels instanceof byte[]) {
    imageData = new ImageData(bb.getWidth(),bb.getHeight(),8,palette);
} else if (pixels instanceof int[]) {{
    imageData = new ImageData(bb.getWidth(),bb.getHeight(),24,palette);
}
</pre>

Original comment by bibi.mul...@gmail.com on 24 Oct 2014 at 6:58