I have many pdf files and i am embeding flexpaper for online book reading. Whenever a user clicks a link, a new windows opens in which embeded flexpaper pdf can be read.

Below mentioned code is in the new window html which is opened by clicking "Read Online".Noew problem is that i have 100+ books for which i have to generate 100 Pages, which i don't want to, i want to pass filename in SWFFile : 'docs/Paperpdf.swf', dynamically in the link or through some sort of PHP code so that only file name changes in new window and i would not need to make 100+ pages.Kindly help

You simply change your name as you see fit. If it's a PHP file, then target a PHP file and add a querystring if needed. If it requires a swf mime, then you simply have your PHP file serve the swf header which is application/x-shockwave-flash from the looks of it.

07-11-2013, 08:53 PM

chintoo123

I think you didn't understood.
1. External Link of 1.pdf -> External page with php code SWFFile : 'docs/A.swf'
External Link of 2.pdf -> External page with php code SWFFile : 'docs/B.swf'
.
.
so on for 100 pages. I need to build 100 pages with same flaxpaper code with the above mentioned line which changes

What i want is to pass name of pdf file eg 1.pdf through variable to External page so that only 1 external page will be required with varying file names. Now how to do it ?
Kindly dictate word by word as i do not know any language except html and css.

07-11-2013, 09:30 PM

Fou-Lu

You'd have a single php file and accept a querystring on it. You would then serve it and read the file though:

Simple as that. Best to add something to deal with the else clause's that I haven't put in there, but no matter what it'd have to be a default swf of some kind (since this needs to be served as swf).
Call it as: yourphpscript.php?swf=A for example.

Edit:
Wait, what's with the PDF's here? Is this something to do with this flexpaper?
I presumed you are looking for a PHP solution to this, so dynamic wise that's all you need to do to serve a file with a given querystring. Otherwise, I haven't a clue what you're trying to do.

Edit:
Am I hung up on swf files for some reason here? What is it you're needing to do with the PDF's directly, just modify them? If so, you'll be needing the PDF library to deal with that: http://php.net/manual/en/book.pdf.php
It does require a PECL installation in order to use it though. There may also be standard PHP user code available for download. This looks like one of them: http://sourceforge.net/projects/pdf-php/

These swf should open in Flexpaper which is embeded in flexpaper.htm. The only part of code which should vary in flexpaper.htm:
.
.
.
SWFFile : 'docs/1.swf',
.
.
.
-> When i click on Book1 on sample.htm , flexpaper.htm should open with code : SWFFile : 'docs/1.swf'
-> Likewise, When i click on Book2 on sample.htm , flexpaper.htm should open with code : SWFFile : 'docs/2.swf'

In this way, only 1 php and 1 flexpaper.htm is required instead of many many pages.I hope i clarified my problem. Kindly give code and method to implement it.

Sorry you disturbing you again and thank you for you previous reply and time.

07-12-2013, 08:54 PM

Fou-Lu

Does it need to be .htm file?
If not, the absolute easiest way to deal with it is to modify the flexpaper.htm and name it flexpaper.php. Then simply modify the swffile to be: 'docs/<?php echo (int)@$_GET['swf'];?>.swf', and then when you call it you would use flexpaper.php?swf=4 for example.

07-13-2013, 12:12 AM

whizard

Fou-lu, not to hijack this thread but can you briefly explain the type casting you did there? Is it for security purposed (ensuring a numerically named .swf is called) or otherwise?

I'm guessing security, but I'd like to know for sure ;)

Thanks
Dan

07-13-2013, 06:41 AM

chintoo123

Thank you, you solved my problem. Thanks many time :)

07-20-2013, 09:45 AM

chintoo123

Can you tell me the code so that only one window opens at a time in external link and same external window updates each time any other link is clicked.