On Wed, 2008-11-12 at 15:10 +0000, Robert Osfield wrote:
> Another day, another curious example... osgpdf ;-)
> 
> In a similar vain to my work on adding vnc support that I did last
> week, the volume rendering project also has a need for viewing pdf
> documents as a way of mixing presentation text/imagery with 3D volumes
> so no I've embarked on adding pdf support directly into the core OSG.
>  Last month Jeremy Moles added support for pdf reading to osgCairo so
> I knew it was possible, and I also had some code to learn from and
> leverage ;-)

Your implementation of the CairoImage class is probably right on track
with the simplest, cleanest way of supporting a Cairo "surface" to draw
on.

We'll need to support (and I'm willing to add this on after you commit
it intially) all of the CAIRO_FORMAT_* args in the "real"
implementation, but that's not hard--just requires settings the
pixelFormat and whatnot.

> So today I embarked on the journey to adding pdf support into the core
> OSG.  The first step is just a small example application, but like
> osgvnc I plan to distil this down into a plugin so that all
> applications can leverage it will little coding effort.  I need to get
> a bit more experience with using Poppler/Cairo and also spend a bit
> more time thinking about the public interface before I make the
> plugin, and I'd also like some feedback from members of the community
> on how well osgpdf works at your end.
> 
> To compile you'll need to latest OSG from svn/trunk.  Cairo and
> Poppler libraries.  These look like they should be available on all
> the major platforms, but I've only been able to test under Linux. Once
> you have Cairo and Poppler installed re-running CMake should be able
> to pick up on Cairo and Poppler and then osgpdf example should
> compile.  If you get things working under Windows or OSX could you
> please write in with what you had to do to get things installed.
> 
> To test osgpdf, simply pass it a pdf document:
> 
>   osgpdf mydocument.pdf

How did you avoid not having to use a fully formed URI? In my code, I
had to use file:/// syntax, or Poppler refused to cooperate. It could be
a library version difference, so we'll need to keep an eye on this...

> Move the mouse of the resulting texture quad and then press 'n' and
> 'p' to step to next and previous pages.  You can also run it with
> multiple documents at once.
> 
>   osgpdf *.pdf
> 
> I've just tested this 22 documents and it worked just fine, although
> each of quads is a bit small on screen to read without zooming in!

In the example code I'm using (svn update about 20 mins ago) the
PageHandler object isn't being added to the viewer event handlers...

> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to