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.

AppGameKit Classic Chat / PDF Reading (bookreader)

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Feb 2016 08:07
Is there a way or likely to be in the future that we can load a pdf file using AGK
and use it as a book reader as there is other software that can do this.

a>The only way I can think of doing this with the current commands is to convert to text file removing all pictures
b>Or turn the PDF into one large picture

ANY SUGGESTIONS ON MAKING A BOOK READER?

Below is some code I have been playing around with that makes use of the virtual screen it does what I wanted but now I'm more concerned about loading large masses of text preferably with pictures



Thanks in Advance for any comments or suggestions
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Feb 2016 08:50
I may be able to do it with each page being a pic and just loading the pages as necessary this just doesn't seem like the best way as with other viewers etc they can have links etc

fubar
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 15th Feb 2016 10:37
Why do you want to make a book reader? There are already good free readers out there.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Feb 2016 11:07
Good question just been thinking of an easier project as I have several on the to do list partly done so I thought ide see what ways there was to achieve this.
Ive also created my own bookreader for pc years ago in C that was password protected etc and thought I could import some of my old documents
fubar
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 15th Feb 2016 11:38
PDF isn't a format supported by AppGameKit so you'd have to build your own renderer. That doesn't sound like an easy project to me. Do-able, but certainly not a simple task. There is an open-source javascript PDF reader available on GITHUB that may give some pointers in how to decode the format.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 15th Feb 2016 12:11 Edited at: 15th Feb 2016 12:13
Quote: "That doesn't sound like an easy project to me"

Thanks for the info CJB. I put a request in for this last month and was hoping, but now a little disappointed. There are lots of formats that could be added however to an alternate format reader/writer so once again, maybe for the future.

In the meantime fubarpk you could manually convert pdf to txt to skip one step but you would soon get stuck on the next.

I made a txt reader, of sorts, back in my DBPro days and with the use of the Enhancement Pack. There were several speech commands including Get Voice API, Set Voice and Send Voice Message, which enable txt to be read out aloud, but no such thing in AGK2......yet.
I can think of many Apps and games that could be enhanced with speech including another one which I had started in DBPro, "Learn to Read" where words were pronounced by the pc to help.

Good luck though fubarpk, its nice to know others would like to see this sort of thing.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 15th Feb 2016 20:26
The primary function of App Game Kit is to make games. PDF reading isn't exactly a requirement for games. So I won't expect support for it soon unless it's easy to implement or more people are requesting it. With so many other things Paul could be doing instead, I don't see the point.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 15th Feb 2016 23:59
Rather than parse the PDF internally or just cutting the text from it, there's bound to be some 3rd party tool somewhere converts PDF->HTML and keeps some of the basic formatting/images in tact. If you can find something, I'd then write a parser to convert html output into a custom mark up. You'll lose some functionality from the original source, but it'd easier than trying to recreate it from the original ripped text.


CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 16th Feb 2016 09:54
If we had Webview commands exposed within AppGameKit, then it would be possible to render the PDF within a webview using the publicly available javascript libraries. Webview would be SO useful for lots of things, including game related stuff.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Feb 2016 10:36
It's doubtful that AppGameKit will ever let you load and view a PDF itself, but you can get Adobe Reader for anything... like if we could use AppGameKit to load files in the default viewer, then we could effectively load and view PDF files, but in the default program, not our own.

It's a shame, because I could make a kick-ass process specification system at work, instead of just using n explorer and adobe reader.

I have made a virtual book in AppGameKit and it works quite well, just rendering each page with a memblock, storing as an image, and applying them to a 3 page book model. It's not a slick PDF but it does the job - I'd actually prefer to read a book on that system than those mobile PDF viewers.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 17th Feb 2016 00:00 Edited at: 17th Feb 2016 00:01
It might be possible to use this open source library in Tier 2.
http://podofo.sourceforge.net/about.html
The coffee is lovely dark and deep,and I have code to write before I sleep.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 17th Feb 2016 00:58
Quote: "If we had Webview commands exposed within AppGameKit, then it would be possible to render the PDF within a webview using the publicly available javascript libraries. Webview would be SO useful for lots of things, including game related stuff. "


Yes, webview capabilities would be hugely beneficial and is exactly what I was going to post here as well. You could use it to display app documentation, credits etc. in ways that would be immensely tedious to try and code manually using AppGameKit text and image commands.

Quote: "The primary function of App Game Kit is to make games. "


Which is sad because with just a few extra features it would be equally aligned for making a variety of apps. Bringing native GUI support (which could also include a webview) would open the door for many new apps that currently require other frameworks. I've done various non-game apps with AppGameKit already including photo processors and drawing apps, and would love to do more of that sort but end up going to other platforms due to these existing limitations.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 17th Feb 2016 10:02
Not saying that we won't see it included at some point. Wasn't GUI commands part of the survey?
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 11th May 2016 16:52 Edited at: 11th May 2016 16:56
Maybe this can help you out a bit, I once wrote the first steps for a html parser, but ran into a small logic error, that I was too lazy to fix, for just a fun project. The parsing and the creation of the objects should be seperated, because sometimes you need more than one information node to parse correctly, for example when you center some blocks of text in one line (like 4 links for navigation) , the group of text blocks has to be centered as one element. later I fixed this logic error in pixl, and could create a full compiler!

WIP HTML Parser for AGK

Please feel free to use it for your own research This project thaught me, that a parser is actually not a devils- work.

[/url]
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th May 2016 14:36
Why not just forget PDF support, and make your own format - like a text file that has formatting, colouring, imbedded images... like an easy hypertext style document. Render an image per page, and have a 3D virtual book. Think of something that hasn't already been done to death... make an easy book format for people to write short stories etc and have them look cool.

The one thing that every single book app I've used is missing, is any sort of illusion that you're reading a book - in the long long ago, books were awesome - big and epic with fancy covers... sometimes carved from wood. If someone writes a story, shouldn't they be able to do more with it than convert to PDF and throw in amongst the billion other books available. Add in ratings, comments etc etc for books, you never know, it could end up as a whole different way for people to publish their work and retain a little of what is cool about books. You could even allow for 'choose your own adventure' style books too, that would be pretty cool - I loved those things as a kid, especially the ones with role play stats, battles and items.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 13th May 2016 16:02
Quote: "choose your own adventure' style books too"
I remember those! Warlock of Firetop Mountain and all that. I remember one that had an error in that you'd turn to a certain page based on your decision and it would take you to a completely unrelated section of the book and you'd have to start again! Haha! Happy days.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Login to post a reply

Server time is: 2024-09-29 13:35:32
Your offset time is: 2024-09-29 13:35:32