Dozz Posted April 30, 2011 Share Posted April 30, 2011 I would like to be able to view a PDF from within my project, be able to open a PDF, view it (zoom and panning) and maybe print if its not to problematic, then close and return to the Leadwerks environment. Advice on its implementation would be great. Searching the net, I found poppler and quickpdflibrary lite, and someone who has used poppler with OpenGL, includes code. Not sure how to integrate inside Leadwerks engine yet, I started on cpp last week. A basic list of 'here's where you start' is what I need Thanks Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 1, 2011 Share Posted May 1, 2011 I suspect you may be treading new ground there Dozz, that's so specific I don't think you'll find anyone who's done that before! Good luck with it though and at least you have an openGL example. There are some examples around of integrating external GUI systems into Leadwerks, they might give you some insight regarding interfacing external code and using openGL directly. You might need to have a first stab at it and then post code so Josh or maybe MasterXilo or others can make suggestions. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
paramecij Posted May 2, 2011 Share Posted May 2, 2011 I would recommend poppler, .. implementing it isn't impossible, but if you're new to cpp or programming you might have a hard time. The first step is to build the library from source or finding a compatible compiled library online (i even might have win32 .dll somewhere) , for this you can download cmake and create a makefile for your platform, but you might also need some other dependencies first ( not sure which ones exactly from memory) .. once you have the appropriate compiled libraries (and dependencies), it's relatively simple (2 lines of code) to load a pdf and render it to an image , which you then upload to a leadwerks texture, with an opengl call (glTexImage2D) .. I remember there are 2 (or 3) ways to go about rendering the image with poppler, one is by using a Splash 'framework' (theres also a qt4 backend) which implements an SplashImage class to which you can render and then obtain the pixels from .. so here's where you start: - get cmake and familiarize yourself with it - search the forums for theora video, to see how to upload custom pixels to a texture - try to compile or obtain poppler libs - .. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.