Two Pilots™    Home  |  Navigation  |  Site map  |  Products  |  Download  |  Order  |  Support  |  Contact us  |  For Publishers  |  OEM

Summer discounts! Summer discounts!

 

How to test the libraries on your server
 

You need to have the following libraries installed on your server:

* Python Imaging Library should be installed on your server if you want to include images in your pdf files.

After the libraries have been installed on your server and you have made all appropriate settings on the server to make the libraries work, you can test the libraries.

 

1. Download the archive that contains test scripts: http://pdfservice.colorpilot.com/test.zip

 

2. Extract the files from the archive into a folder on your computer. You will need the following scripts:

 

test1.py - for testing the Python library.

 

test2.py - for testing the ReportLab Toolkit library and pdf generation.

 

test3.py - for testing the ReportLab Toolkit library and Python Imaging Library (generation of pdf files with images).

If you do not want to include images in your pdf files, you don't have to run this test.

 

The following scripts should be edited first:

 

test4.py

This is a test of sending an e-mail from your server.

You need to enter the following information into this script:

server = r'your-mail-server.com'
Instead of your-mail-server.com, enter your mail server address.

from_addr = 'info@your-mail-server.com'
Instead of info@your-mail-server.com, enter the address your messages should be sent from.

to_addr = 'info@your-mail-server.com'
Instead of info@your-mail-server.com, enter the address your messages should be sent to.

If you don't need to send messages from your server, you don't have to run this test.

 

test5.py

This is a test for a database (if you use a database). It is meant for a MySQL database only.

Enter the following information of your database:

host = ""
login = ""
password = ""
database = ""

If you are not going to use a database, you don't have to run this test.

 

3. After you have edited the scripts, copy all the files to your server into an appropriate folder.

Your server should have the following settings:

  • it should allow you to write to the folder where you run your test scripts;
  • it should allow you to execute the scripts in this folder.

 

4. Run the scripts in your browser

For example:

http://www.your-site.com/test1.py

http://www.your-site.com/test2.py

and so one

If the test runs correctly, you will see the following message: "test 1 is passed" (test 2 is passed, etc.)

 

5. If the test can't be executed, and if your server runs on the *nix platform, try to edit the first line of all the scripts:

Instead of:
#!/usr/bin/python

Use this line:
#!/usr/local/bin/python

 

6. If this doesn't help and the test scripts still won't run, please contact your server provider/administrator.

Perhaps:

  • The Python and ReportLab Toolkit libraries are not installed correctly (no proper settings were made for these libraries on the server).
  • The folder you uploaded the scripts to, and the scripts themselves, do not have appropriate rights (see item 3).

 

- PDF Online Custom Service page -

 

Page top