(S)FTP Uploads

The PDF Printer has a feature that will upload the created PDF file to a server. Both FTP and HTTP uploads of the PDF document are supported. This means that you can send the documents to a web server that you have created and do some processing in a cloud application. Uploading to an FTP or SFTP server is simply a matter of setting up a server to receive the files.

The following screenshot shows the tab / tab provided for uploads within the options dialog window of the PDF printer. HTTP(s) or FTP(s) settings can be conveniently defined via the GUI:

Tab UPLOAD in the options dialog of the printer
Illustration: Tab UPLOAD in the options dialog of the printer

With FTP uploads, the PDF printer issues a message that a professional license file is required, with (S) FTP a license file from the Expert Edition, but you can then use / test the function. In this case, a TRAIL MODE watermark text is inserted into the relevant PDF in the footer area. After licensing the PDF printer, the information dialog and trail mode watermark are no longer required.

HTTP(s) Uploads

HTTP and HTTPS are supported via the normal file upload protocol. It requires that you create a script on your server that will receive the uploaded file. You can test your upload script by creating a simple “File Upload” form on a web page. The code could look something like this:

<form action="upload.php" method="post" enctype="multipart/form-data">
    Select file to upload:<br>
    <input type="file" name="file" id="file"><br>
    <input type="submit" value="Upload File" name="submit"><br>
</form>

The page that receives the file can be written using any web server language. Here is an example in PHP.

<?php
$filename = basename($_FILES["file"]["name"]);
if (move_uploaded_file($_FILES["file"]["tmp_name"], $filename.".tmp")) 
{
    // This file is copied so that the webserver 
    does not set itself as owner of the file.
    copy($filename.".tmp", "uploaded-".$filename);
    unlink($filename.".tmp");
    echo "The file '".$filename."' was uploaded.";
}
else
{
    echo "Error";
}
?>

With HTTP uploads, the PDF printer issues a message that a professional license file is required, with HTTPS a license file from the Expert Edition, but you can then use / test the function. In this case, a TRAIL MODE watermark text is inserted into the relevant PDF in the footer area. After licensing the PDF printer, the information dialog and trail mode watermark are no longer required.

Configure the printer for upload

You can tell the printer to upload to your HTTP handler by adding these settings:

uploadprotocol1=HTTP
uploadserveraddress1=http://yourserver/your_script.php

Additional parameters are available for setting password and user name if needed.

The upload settings can be set from a program using the API or in the global.ini files that control the global settings for a printer.

This an example of typical settings to set when working with an upload scenario.

Output=my output file name
ShowSettings=never
ShowPDF=no
ShowProgress=no
ShowProgressFinished=no
ConfirmOverwrite=no
StatusFile=my status file name
StatusFileEncoding=unicode
DeleteOutput=yes
suppresserrors=yes
uploadprotocol1=HTTP
uploadserveraddress1=http://localhost/test/upload.php

LiveZilla Live Chat Software
Top