Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / A Pdf reader dll called DBPdf , time to read up some ebooks :)

Author
Message
faizeq
16
Years of Service
User Offline
Joined: 13th Oct 2008
Location: Under the table
Posted: 21st Oct 2011 18:51
I've been working with some projects involving PDF reader during my work and with some spare time I've managed to create this nifty little Dll to load up PDF file into DB.
It loads up PDF pages into DB image pointers so that you can just paste it to any of your DB objects.
As usual, I've included the source and a simple demo into one rar file for the taking.
Feel free to use it for what ever purpose you have and if there is any issue or requests.. feel free to drop me a line ..

Cheers..

Life begin where ->BeginScene() end it ends at ->EndScene()..so please Present(NULL, NULL, NULL, NULL);

Attachments

Login to view attachments
NickH
16
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 22nd Oct 2011 17:07
Sounds like a nice dll

IlluminatedFX.com
For web design and graphic design services
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 23rd Oct 2011 00:42
Cool

Could you add the ability to extract text from the .pdf and save it into a .txt file? I ask because at work I have to load .pdf files in a reader and resave it as .txt to be able to extract data for my own programs. Also would it be hard to add a .pdf creation ability by adding pictures to a .pdf?

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 23rd Oct 2011 03:48
Wow! Nice...

This is definitely one those random extras that no-one was expecting and it can be very useful...

Big thumbs up...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
faizeq
16
Years of Service
User Offline
Joined: 13th Oct 2008
Location: Under the table
Posted: 24th Oct 2011 06:07 Edited at: 22nd Jul 2014 00:54
Thanks for the comments there peeps Appreciate it heaps...

For Grog the text extraction function have been added to the new quick update ..As long as the page have embedded text instead of just scanned text you wont face any problem getting the text out into a txt file. As for the adding up picture bit there... its going to be much more trickier I'm afraid

DBPdf V1.1

Life begin where ->BeginScene() and it ends at ->EndScene()..so please Present(NULL, NULL, NULL, NULL);

Attachments

Login to view attachments
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Oct 2011 11:05
Cool thanks! Using that text extractor directly in my program will save me from having to use an external reader. It's ok about not getting the last part this new command will help me a lot.

gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 1st Nov 2011 13:44 Edited at: 1st Nov 2011 13:48
faizeq
I just found out about

"A Pdf reader dll"

through the "Issue 106 The Game Creators Newsletter"

this will defiantly add to things I have planed ;o)
Thanks for creating

the text dump dose not seam to happen
also in the example was the keys to be pressed were not shown in the menu
to save you time on that I add them in

one addition to the example I would like
to zoom in and out on the pdf

to move side ways - is to move forward
Since a Strait line gets thin fast

Attachments

Login to view attachments
faizeq
16
Years of Service
User Offline
Joined: 13th Oct 2008
Location: Under the table
Posted: 2nd Nov 2011 16:57
Hi there Resourceful..glad to hear that the dll might be of use.

The text dumping function do work, it just that you need to make sure that the Pdf page itself is not just scanned images. As you might had notice nowadays people have been favoring to use PDF software printer to print stuffs to PDF. This just plainly eliminates the text as it just merge everything into one big image file. So without any valid text structure it would be impossible to get any text out of it... Unless you can create an OCR shader or some sort of text detection from image then it could be possible...

As for the zooming function... the page was actually rendered on a 3d plane.. so pretty much we can just move the DB camera anywhere you like.. here is a little function ..a little bit crude but you you'll see how it can be done...(just conjured this up on the back of my head, might not function as it might be..huhuhu)


Before the loop add this three declaration:




In the loop add this code:




Well this is just a simple snapshot example..maybe you can add a more intelligent camera workings and logic..

Cheers...

Life begin where ->BeginScene() end it ends at ->EndScene()..so please Present(NULL, NULL, NULL, NULL);
Paradox452
13
Years of Service
User Offline
Joined: 29th Jul 2011
Location:
Posted: 3rd Nov 2011 00:45
Wow, this sounds like it might be cool to use

<img src="http://i1129.photobucket.com/albums/m510/Anomaly0117/Signatures/mySig2.png">
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 3rd Nov 2011 02:23
faizeq


thanks for the code

the option I tried for the zoom sort of worked but
when you try to un zoom things got flipped and the scale got messed up

I will put the code you talked about and see what happens

as the text dump

I can understand that it needs to be a text only and not an image
as for the ocr part making such a dll is beyond me but
making logic setup to look for text and then converting it
would take me a bit to work out like few years ;o) lol

not impossible but defiantly a thinker problem

in the old days before windows there was dos
and for games they made a program to load a text file

this one is basically the same idea but with more options
Thanks to Open Office you can make your own pdf from and other type
of text file and include images a far vast improvement over the old days ;o)

now if only the forum would send me copy of my posted message ;o)
so i could have a copy of it ;o)

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 4th Nov 2011 08:18
faizeq

the zoom you built
is right and yes I will working on it

it is much closer to what I was after

thanks

to move side ways - is to move forward
Since a Strait line gets thin fast

Login to post a reply

Server time is: 2024-11-23 17:06:14
Your offset time is: 2024-11-23 17:06:14