Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

[APPLICATION] PdfServer 1.0


headkaze

Recommended Posts

This is a program based on Howard Casto's recent proposal for an app to read pdf's on a portable device. His idea was to e-mail them to the device and I don't think it's the best way to do it because they are often large and there are lag times when sending and receiving e-mail.

So I came up with the idea of serving up a pdf directly through a mini web server. This means it's pretty much immediate but it also means you can have a whole bunch of pdf's stored on a PC and serve them up to any portable device. It also has the added bonus of not taking up valuable space on your portable device. I've tested it on my iPod and iPad and it works quite well.

It's pretty simple to use.. you run the PdfServer.exe which will create a PdfServer.ini file. You can leave the defaults and test it's working on locahost by entering http://localhost:8080 into a web browser. Included is the 1942.pdf for test purposes so if you can view that then it's working. Now you can put your PC's internal IP into PdfServer.ini and access the pdf's from a portable device using wifi. Eg. http://192.168.1.123:8080

The only downside to this system is it's one way communication at the moment. So you get a list of pdf's and you scroll through to select the one you want to view, rather than have the PC serve up the pdf of the currently running game, for example. But I think this is better anyway because you can use it for any pdf's you want and not just manuals for MAME.

Download PdfServer 1.0

post-367-0-77093400-1343184880_thumb.png

post-367-0-02670500-1343184974_thumb.png

post-367-0-69842600-1343185300_thumb.png

post-367-0-03711100-1343185479_thumb.png

  • Like 3
Link to comment
Share on other sites

Nice one. A while back I was thinking about doing an online version of something similar.

Being able to read MAME manuals directly on gamesdbase.com would be sweet. I can send you the source if you like although I'm sure the requirements would be quite different. You would most likely need to pre-process the pdf into images rather than generate the pages on the fly and store the page count in the database.

Link to comment
Share on other sites

Yes I use GhostScript to turn them into images then serve them up in a html file that has First/Last/Previous/Next controls to browse through the document.

The way it works is you place a folder full of pdf's into the ini file and when you set your browser to the IP/Port it will list all the pdf's. From there you select a pdf and start viewing it page by page. Selecting the Home link goes back to the list of pdf's.

I think this is something that could work for GameExtender too as well as other content served up through GameEx.

EDIT: I've uploaded some screenshots to the first post.

Link to comment
Share on other sites

Thanks

Yes I use GhostScript to turn them into images then serve them up in a html file that has First/Last/Previous/Next controls to browse through the document.

The way it works is you place a folder full of pdf's into the ini file and when you set your browser to the IP/Port it will list all the pdf's. From there you select a pdf and start viewing it page by page. Selecting the Home link goes back to the list of pdf's.

I think this is something that could work for GameExtender too as well as other content served up through GameEx.

This is an awesome release HK! I've often thought about how it would be cool to be playing a game on my HTPC and able to access the manual and/or strategy guide from my tablet. I mean technically I can right now, but it's a manual process rather than an automated one (which is wonky).

Incorporating this functionality into GameExtender would be flippin' sweet!

As I'm typing this, an idea has occurred to me.

  • Point the server at an empty directory
  • Create a batch process to run as a Launch Before parameter in GameEx. This batch file would copy the manual/strategy guide/whatever other PDF related to the launched game into the server directory.
  • Dynamically access material for the game that's currently running in GameEx
  • A Launch After batch removes the copied files from the server directory when you exit the game

I'm going to have to test this out. Does the server dynamically pole the PDF directory, so that it instantly recognizes updates? Or do you need to manually scan the directory to recognize updates (I imagine rebooting the server would also work if this was the case).

Just curious, and I'm sure I'll suss it out once I take it for a test drive. Thanks again for the awesome contribution HK! :D

Link to comment
Share on other sites

Awesome, I was hoping you's say that! I was also glad to see that the port number was configurable, as 8080 is already taken on my host machine. Once again, I'm really pumped about this one. Thanks again.

Just out of curiosity, did you bang this out in the span of time between Howard Casto announcing his project and now? Because if that's the case ... Damn! That's some power-coding! :o

Great work!

Link to comment
Share on other sites

It's an idea I've had for a while but I only started writing it yesterday. I was in the middle of writing a post in Howard's thread about it and then it occured to me that since he still codes in VB6 it would likely be a much more difficult task for him to write. I've tried to encourage Howard to check out VB.NET over the years but he's adament to stick with VB6. This a perfect example of why he should move to .NET.

This program only took a few hours to write because .NET has some great classes for establishing socket connections in only a few lines of code. I started with some code from The Code Project (Create your own Web Server using C#) and after a bit of fiddling around and reusing some pdf handling code from CPWizard (using GhostScript) I could see how it would work. It's hardly polished but it gets the job done.

One of the things that spurred me on was having a number of eBooks that I wanted to read on my iPad. The only way I knew how to get them there was to e-mail them. It's a PITA. Reading them this way is not as nice as using iBooks but it does solve the problem of getting them onto the device easily. If I get some spare time I may spend some more time on it but I have alot of other important projects I need to get back to.

  • Like 1
Link to comment
Share on other sites

A bit off topic, but like you I've also started reading books primarily on my tablet. If you haven't checked it out already, Calibre is a really awesome tool for managing your e-book library which also includes a server component for the purposes of accessibility from a tablet. It handles PDFs, but particularly excels at EPUB, MOBI, and the more 'traditional' e-book formats. It's worth a look if you haven't tried it.

Still chomping at the bit to test drive the PDFServer. I can connect to the server, but as it turns out I don't have GhostScript installed, so it doesn't render the PDFs yet. I'm pretty sure I can install GhostScript with the offline GameEx install (I need to update to 12.78 anyway), but Tom is migrating servers, so I'm out of luck for now. :(

I still have something to look forward to! :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...