OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

PDF rendering inside OSG


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
alessandro terenzi
Guest





PostPosted: Sat Oct 11, 2008 8:30 pm    Post subject:
PDF rendering inside OSG
Reply with quote

I would like to read pdf documents, process them in some way, and finally render them inside my osg application.
How can I do it in osg?

Thank you. Best regards.
Alessandro

------------------
Post generated by Mail2Forum
Back to top
sicong he
Guest





PostPosted: Sun Oct 12, 2008 8:07 am    Post subject:
PDF rendering inside OSG
Reply with quote

Hi, Alessandro,
Try rendering them to a texture and bind them to OSG geometry. That should work.

2008/10/12 alessandro terenzi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
I would like to read pdf documents, process them in some way, and finally render them inside my osg application.
How can I do it in osg?

Thank you. Best regards.
Alessandro



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
alessandro terenzi
Guest





PostPosted: Sun Oct 12, 2008 9:03 am    Post subject:
PDF rendering inside OSG
Reply with quote

Yes, actually that was also my idea and I know that Adobe supplies the Acrobat SDK, I wonder if anybody tried to use it to render pdf documents inside OSG/OpenGL? Or there exist another way to do it?

Alessandro

On Sun, Oct 12, 2008 at 10:07 AM, sicong he < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi, Alessandro,
Try rendering them to a texture and bind them to OSG geometry. That should work.

2008/10/12 alessandro terenzi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:

I would like to read pdf documents, process them in some way, and finally render them inside my osg application.
How can I do it in osg?

Thank you. Best regards.
Alessandro





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
Gerwin de Haan
Guest





PostPosted: Sun Oct 12, 2008 1:55 pm    Post subject:
PDF rendering inside OSG
Reply with quote

You might want to try and use ghostscript commands to convert pages of
the pdf to intermediate bitmap images. For example, this is what I
used:
gs -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -r72x72 -dNOPAUSE
-sOutputFile=Image%02d.jpg Image.pdf

As another approach, you could try to use osgCairo:
http://www.ohloh.net/projects/osgcairo. This nodekit uses Cairo (load
pdfs, svg, create vector graphics) to create osg::Images directly.

keep us updated on your progress!
Gerwin

On Sun, Oct 12, 2008 at 10:30 AM, alessandro terenzi
<> wrote:
Quote:

Yes, actually that was also my idea and I know that Adobe supplies the Acrobat SDK, I wonder if anybody tried to use it to render pdf documents inside OSG/OpenGL? Or there exist another way to do it?

Alessandro
On Sun, Oct 12, 2008 at 10:07 AM, sicong he <> wrote:
Quote:

Hi, Alessandro,
Try rendering them to a texture and bind them to OSG geometry. That should work.

2008/10/12 alessandro terenzi <>
Quote:

I would like to read pdf documents, process them in some way, and finally render them inside my osg application.
How can I do it in osg?

Thank you. Best regards.
Alessandro













------------------
Post generated by Mail2Forum
Back to top
alessandro terenzi
Guest





PostPosted: Sun Oct 12, 2008 3:26 pm    Post subject:
PDF rendering inside OSG
Reply with quote

Thank you very much for your suggestions...I'm going to make some tries as soon as I can.

Alessandro


On Sun, Oct 12, 2008 at 3:55 PM, Gerwin de Haan < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
You might want to try and use ghostscript commands to convert pages of
the pdf to intermediate bitmap images. For example, this is what I
used:
gs -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -r72x72 -dNOPAUSE
-sOutputFile=Image%02d.jpg Image.pdf

As another approach, you could try to use osgCairo:
http://www.ohloh.net/projects/osgcairo. This nodekit uses Cairo (load
pdfs, svg, create vector graphics) to create osg::Images directly.

keep us updated on your progress!
Gerwin


On Sun, Oct 12, 2008 at 10:30 AM, alessandro terenzi
< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:

Yes, actually that was also my idea and I know that Adobe supplies the Acrobat SDK, I wonder if anybody tried to use it to render pdf documents inside OSG/OpenGL? Or there exist another way to do it?

Alessandro
On Sun, Oct 12, 2008 at 10:07 AM, sicong he < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:

Hi, Alessandro,
Try rendering them to a texture and bind them to OSG geometry. That should work.

2008/10/12 alessandro terenzi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:

I would like to read pdf documents, process them in some way, and finally render them inside my osg application.
How can I do it in osg?

Thank you. Best regards.
Alessandro

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




------------------
Post generated by Mail2Forum
Back to top
Jeremy Moles
Guest





PostPosted: Tue Oct 14, 2008 5:42 pm    Post subject:
PDF rendering inside OSG
Reply with quote

On Sat, 2008-10-11 at 22:30 +0200, alessandro terenzi wrote:
Quote:
I would like to read pdf documents, process them in some way, and
finally render them inside my osg application.
How can I do it in osg?

I can add this power to osgCairo if you want; would take about an hour.

Quote:
Thank you. Best regards.
Alessandro





------------------
Post generated by Mail2Forum
Back to top
Jeremy Moles
Guest





PostPosted: Tue Oct 14, 2008 8:08 pm    Post subject:
PDF rendering inside OSG
Reply with quote

On Tue, 2008-10-14 at 21:59 +0200, Gerwin de Haan wrote:
Quote:
Jeremy, if you have an hour to spare, that would be great!

After I replied to Alessandro to give osgCairo a try I did so myself.
Works like a charm, but the loading of both svg and pdfs is not
directly supported by cairo itself, is it?
For svg, I recall to have played around with a seperate svg parser
which renders to cairo.
For pdf, it seems one needs a pdf parser (e.g. poppler).
What's your thought on that?

Yes, you're exactly right.

I'm about 30 minutes away from having Poppler support in osgCairo in the
OSG'ish form of:

-----------------------------------------

#incude <osgCairo/ReadFile>

osgCairo::ImageVector iv;

if(osgCairo::readImagePDF("foo.pdf", iv, 256, 256)) {
...
}

-----------------------------------------

But this does require poppler. I'll also add support for libsrvg and
whatnot as I need it, but I kind write osgCairo as I go to support
osgWidget and osgPango. The good thing, though, is that once you get the
PDF's into the osgCairo::Image object, nothing stops you from editing
them any way you want. Smile

Quote:
From what I read, poppler should work in Windows too, but I can't say
for sure how hard that would be.

Quote:
On Tue, Oct 14, 2008 at 7:41 PM, Jeremy Moles <> wrote:
Quote:
On Sat, 2008-10-11 at 22:30 +0200, alessandro terenzi wrote:
Quote:
I would like to read pdf documents, process them in some way, and
finally render them inside my osg application.
How can I do it in osg?

I can add this power to osgCairo if you want; would take about an hour.

Quote:
Thank you. Best regards.
Alessandro










------------------
Post generated by Mail2Forum
Back to top
Jeremy Moles
Guest





PostPosted: Tue Oct 14, 2008 8:10 pm    Post subject:
PDF rendering inside OSG
Reply with quote

On Tue, 2008-10-14 at 21:59 +0200, Gerwin de Haan wrote:
Quote:
Jeremy, if you have an hour to spare, that would be great!

After I replied to Alessandro to give osgCairo a try I did so myself.
Works like a charm, but the loading of both svg and pdfs is not
directly supported by cairo itself, is it?
For svg, I recall to have played around with a seperate svg parser
which renders to cairo.
For pdf, it seems one needs a pdf parser (e.g. poppler).
What's your thought on that?

OH, also! What is this ohloh site, and why does it know so much!? Smile

Quote:
On Tue, Oct 14, 2008 at 7:41 PM, Jeremy Moles <> wrote:
Quote:
On Sat, 2008-10-11 at 22:30 +0200, alessandro terenzi wrote:
Quote:
I would like to read pdf documents, process them in some way, and
finally render them inside my osg application.
How can I do it in osg?

I can add this power to osgCairo if you want; would take about an hour.

Quote:
Thank you. Best regards.
Alessandro










------------------
Post generated by Mail2Forum
Back to top
Gerwin de Haan
Guest





PostPosted: Tue Oct 14, 2008 8:14 pm    Post subject:
PDF rendering inside OSG
Reply with quote

Jeremy, if you have an hour to spare, that would be great!

After I replied to Alessandro to give osgCairo a try I did so myself.
Works like a charm, but the loading of both svg and pdfs is not
directly supported by cairo itself, is it?
For svg, I recall to have played around with a seperate svg parser
which renders to cairo.
For pdf, it seems one needs a pdf parser (e.g. poppler).
What's your thought on that?

On Tue, Oct 14, 2008 at 7:41 PM, Jeremy Moles <> wrote:
Quote:
On Sat, 2008-10-11 at 22:30 +0200, alessandro terenzi wrote:
Quote:
I would like to read pdf documents, process them in some way, and
finally render them inside my osg application.
How can I do it in osg?

I can add this power to osgCairo if you want; would take about an hour.

Quote:
Thank you. Best regards.
Alessandro







------------------
Post generated by Mail2Forum
Back to top
Jeremy Moles
Guest





PostPosted: Tue Oct 14, 2008 9:58 pm    Post subject:
PDF rendering inside OSG
Reply with quote

On Tue, 2008-10-14 at 16:07 -0400, Jeremy Moles wrote:
Quote:
On Tue, 2008-10-14 at 21:59 +0200, Gerwin de Haan wrote:
Quote:
Jeremy, if you have an hour to spare, that would be great!

After I replied to Alessandro to give osgCairo a try I did so myself.
Works like a charm, but the loading of both svg and pdfs is not
directly supported by cairo itself, is it?
For svg, I recall to have played around with a seperate svg parser
which renders to cairo.
For pdf, it seems one needs a pdf parser (e.g. poppler).
What's your thought on that?

Yes, you're exactly right.

I'm about 30 minutes away from having Poppler support in osgCairo in the
OSG'ish form of:

-----------------------------------------

#incude <osgCairo/ReadFile>

osgCairo::ImageVector iv;

if(osgCairo::readImagePDF("foo.pdf", iv, 256, 256)) {
...
}

-----------------------------------------

But this does require poppler. I'll also add support for libsrvg and
whatnot as I need it, but I kind write osgCairo as I go to support
osgWidget and osgPango. The good thing, though, is that once you get the
PDF's into the osgCairo::Image object, nothing stops you from editing
them any way you want. Smile

Quote:
From what I read, poppler should work in Windows too, but I can't say
for sure how hard that would be.

Okay, so, from the man who brought you all kinds of other useless
software comes PDF rendering directly to an osg::Image (more
specifically, osgCairo::Image) using osgCairo + poppler.

Obligatory Screenshot:

http://the-bob.org/~jlmoles/osgCairo-pdf.png

...this is part of the GLSL presentation Mike gave...

Of course, it's just a quick hack, but the power is there. And... I take
payment in the form of linkedin referrals! Smile

Quote:
Quote:
On Tue, Oct 14, 2008 at 7:41 PM, Jeremy Moles <> wrote:
Quote:
On Sat, 2008-10-11 at 22:30 +0200, alessandro terenzi wrote:
Quote:
I would like to read pdf documents, process them in some way, and
finally render them inside my osg application.
How can I do it in osg?

I can add this power to osgCairo if you want; would take about an hour.

Quote:
Thank you. Best regards.
Alessandro













------------------
Post generated by Mail2Forum
Back to top
Skylark (Jean-S├ębastien Guay)
Professional


Joined: 05 Jan 2009
Posts: 2249

PostPosted: Wed Oct 15, 2008 1:20 pm    Post subject:
PDF rendering inside OSG
Reply with quote

Hi Jeremy,

Quote:
Okay, so, from the man who brought you all kinds of other useless
software [...]

Hey, with an introduction like that how can you possibly go wrong!

Quote:
comes PDF rendering directly to an osg::Image (more
specifically, osgCairo::Image) using osgCairo + poppler.

Obligatory Screenshot:

http://the-bob.org/~jlmoles/osgCairo-pdf.png

...this is part of the GLSL presentation Mike gave...

That's extremely cool.

BTW, I'm still committed to getting your stuff (osgCairo and osgPango)
to work on Win32, just been a little sidetracked. It's for a personal
project so delays like that are to be expected... Smile

Good work yet again,

J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts two pass rendering without enhancing ... Trajce Nikolov NICK General 2 Tue Jul 02, 2019 9:58 am View latest post
No new posts Rendering a Depthmap lucasamparo General 2 Tue Jun 04, 2019 6:27 pm View latest post
No new posts Layered rendering with a geometry shader AnyOldName3 General 8 Tue May 14, 2019 11:25 pm View latest post
No new posts off screen rendering with OSG Sorin General 0 Mon May 13, 2019 8:14 am View latest post
No new posts Volume Rendering and Depth Buffer AnnieOwl General 5 Fri Apr 12, 2019 5:20 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP