Ken
|
| Posted: 08/13/2002, 8:17 PM |
|
Does anyone know how to export MySQL data to PDF using CCS and PHP 4.0? Is there a simple way? I have already researched this site and not found anything working with CCS. Thanks in advance!
|
|
|
 |
kangus
|
| Posted: 08/14/2002, 2:07 AM |
|
http://www.php.net/manual/en/ref.fdf.php http://www.php.net/manual/en/ref.pdf.php http://www.pdflib.com/pdflib/index.html
I downloaded the pdflib.com samples then enabled by web server to support pdf. The samples ran without a problem, I didn't have to install the pdflib.dll as it was already in the php extensions folder.
FDF and PDF file processing can be done on the server. Your server must have Safe_mode turned off.
|
|
|
 |
Ron
|
| Posted: 08/14/2002, 4:15 AM |
|
Ken,
This topic was discussed here before. Please refer to the prior postings:
http://www.gotocode.com/disc_viewt.asp?mid=6816 http://www.gotocode.com/disc_viewt.asp?mid=7015
Hope it helps.
|
|
|
 |
EMG
|
| Posted: 08/14/2002, 7:25 AM |
|
$fdfdata = "%FDF-1.2\n%aaIO\n";
$fdfdata .= "1 0 obj \n<< /FDF ";
$fdfdata .= "<< /Fields [\n";
// iterate here to add multiple field/values
$fdfdata.="<< /V ($value)/T (FieldNameOnPDF) >> ";
$fdfdata .= "]\n";
$fdfdata .= "/F ($url) >>";
$fdfdata .= ">>\nendobj\ntrailer\n<<\n/Root 1 0 R\n>>\n";
$fdfdata .= "%%EOF";
header ("Content-Type: application/vnd.fdf");
|
|
|
 |
EMG
|
| Posted: 08/14/2002, 7:28 AM |
|
sorry, hit the enter key before I was finished:
$fdfdata = "%FDF-1.2\n%aaIO\n";
$fdfdata .= "1 0 obj \n<< /FDF ";
$fdfdata .= "<< /Fields [\n";
// iterate here to add multiple field/values
$fdfdata.="<< /V ($value)/T (FieldNameOnPDF) >> ";
$fdfdata .= "]\n";
$fdfdata .= "/F ($url) >>";
$fdfdata .= ">>\nendobj\ntrailer\n<<\n/Root 1 0 R\n>>\n";
$fdfdata .= "%%EOF";
header ("Content-Type: application/vnd.fdf");
echo($fdfdata);
// Note:
// Do not send any other headers (including session_start())
|
|
|
 |
EMG
|
| Posted: 08/14/2002, 7:37 AM |
|
sorry, here is more info:
To use FDF in CCS:
1. put the above code into a seperate .php file (non CCS generated)
2. To get database access on your non-CCS page put
define("RelativePath", ".");
include(RelativePath . "/Common.php");
3. CCS' common.php has session_start() on line 14. This will send headers and give an acrobat error (usually "file not found"). To over come this I name my non-CCS file with the letters "Pdf" and modified the common.php file with:
global $PHP_SELF;
if (! strstr($PHP_SELF, "Pdf")) session_start();
4. In the last posting the $url variable needs to be the complete url to your actual pdf file that is used as template.
Hope this helps
|
|
|
 |
Ken
|
| Posted: 08/14/2002, 7:13 PM |
|
Thanks for the comments. Looks like I am going to be busy!
|
|
|
 |
Sanders
|
| Posted: 08/15/2002, 8:01 AM |
|
Please refer to the prior postings: http://www.gotocode.com/disc_viewt.asp?mid=6816
I hoop that it helps.
|
|
|
 |