CCSPdf Converter Ver. 2.4
CodeCharge Studio PDF Conversion Page Template.
Review the file /documentation/README.txt for Server considerations
Copy the contents of this Archive into your CCS project folder you want to add this function to.
Remember that when you publish your project the first time set upload settings to "All Files" or upload these directories to your server manualy. Then ensure the tmp folder has write permissions set on your server. Also ensure your server supports MIME Type application/pdf.
Do a "Save As" of this page name you want it to be in your project.
Open your new renamed page and remove all this text and begin creating your CCS Page.
If you need to modify the PDF conversion code, you will find it in the before output event, custom code.
Be sure your site/sever has a tmp folder created with write permissions. on some servers you may need to write enable /lib/lib/fonts.
To convert this page to pdf call it with _convert=yes (or any value.) This coversion will work for methods GET or POST.
Tip for displaying Images or using Style Sheets: In the convert code it might be necessary to modify the -b parameter so DOMPDF can find the path to your images or style sheets. You might have to experiment with that switch to get images and Styles properly in your PDF.
Please refer to the DOMPDF documentation found at: http://www.digitaljunkies.ca/dompdf/ for DOMPDF usage notes.
The version of DOMPDF included here ia a modified version and renamed. The modifications I have made include a patch to remove the known security issue as well as modifications to fix CGI mode problems of DOMPDF. Also, The ability to run in CLI mode has been removed. It has also been configured for you to be compatible with CodeCharge Studio Applications.
To set parameters for retaining keeping the generated PDF and HTML files as well as setting for Windows server operation, Locate the defines at the top of your CCS events file and set appropriately.
The actual conversion routines for PDF conversion can be found for modifications or debugging in this pages before output event in the cusom code found there. You will also find debugging comments there. If modifications to thet code have been made by you, it is impossible for me to provide any support.
**Note: This may not work on your development machine. It is dependent on the local PHP installation must support PHP in CGI mode. DOMPDF requires the php_pdf, CPDF, or GD libraries installed in your PHP extensions directory and enabled in PHP.INI to operate (located in the documentation directory). Ensure you have the proper libraries installed in the php extensions dir and php.ini entries made. DOMPDF claims it will work with the GD directory but only experimental. More information regarding this can be found in the lib/jjrpdf_config.inc.php file at the define for "DOMPDF_PDF_BACKEND". This will explain this aspect of DOMPDF configuration with links to possible sources of the libraries. Also, for your windows installation, you might need to install the 2 php dll's found in the documentation directory and follow the instructions in the README file.
This release will also allow the use of an alternative and more efficient server side converter. It is called HTMLDOC and is available at http://www.htmldoc.org. This is not free software and must be compiled on your server and there is only Unix/Linux versions of this utility. However, it is significantly more powerful than dompdf.
Using HTMLDOC will allow you to use this code to create PDFs in any language. To implement in another language you must either convert the custom code in this modure to your target language or you can create a Convert To PDF action in the before output event in the language you will be using. Then you can use this code as a guide for modifying the new languages code.
Added support for Windows Servers
Added support for retaining generated files for your own custom processing eg: move to a clients folder or add to a database etc.
Added additional DOMPDF Information
Added files to force creation of tmp directory at your server (remember to make it write enabled on linux chmod 777)
Added dummy index.php to subdirectories to help with server security.
Included php_pdf dlls for Windows.
Additional Debugging exits in the Before Output Custom Code for PDF Conversion.
Added Support for HTMLDOC http://www.htmldoc.org
Repaired a problem with Auto Detect for the PDF Engine.
Selectable PDF Rendering Engines ie:DOMPDF, PDFLib, HTMLDOC Added Support For Dynamic Images conversion.
Automatic Configuration for Windows vs. Linux Servers.
More User Configuration Options and Methods.
Improved Debug Support.
More Documentation in the Before Output Module.