Printing over the Internet brings the way people like to read and write to the way we plumb information in the 21st century. The idea is to enable authors to create documents using their favorite editor and then print it to a web site. Once on the web server, the PostScript print stream can be converted to PDF and posted online for reading or downloading. In this scenario, the author controls the source document and is responsible for maintenance.
This tips uses HTTP file submission to transfer PostScript to a web server. A more formal solution would use CUPS (http://www.cups.org). For a CUPS-based PDF creation server, try Alambic (http://alambic.iroise.net). Alambic supports HTTP and SMTP interfaces.
This tips demonstrates how to "print" a PostScript print stream to a web server. In our examples, we won't be printing to an elaborate document hosting service. Instead, we will print to the simple http://www.ps2pdf.com web site.
Currently, http://www.ps2pdf.com uses an old version of Ghostscript, so printing to your own, local version of Ghostscript will yield a better PDF.
Download and Install
Visit http://www.pdfhacks.com/submit_file/ and download submit_file-1.0.zip. Unzip this archive, and then copy SubmitFile.exe to a convenient location. This is a simple program that uses the Windows WinInet API to submit a local file to a web server. It then opens the default web browser to view the server's response. The source code is available and you should consult it for HTTP submission details.
Install a ps2pdf.com Printer
The procedure for creating an Internet printer is the same as the procedure for creating the PDF printer in [Hack #39], except you don't need to install Ghostscript. The configuration is also a little different.
Follow the Print to PDF instructions, except:
This tips uses HTTP file submission to transfer PostScript to a web server. A more formal solution would use CUPS (http://www.cups.org). For a CUPS-based PDF creation server, try Alambic (http://alambic.iroise.net). Alambic supports HTTP and SMTP interfaces.
This tips demonstrates how to "print" a PostScript print stream to a web server. In our examples, we won't be printing to an elaborate document hosting service. Instead, we will print to the simple http://www.ps2pdf.com web site.
Currently, http://www.ps2pdf.com uses an old version of Ghostscript, so printing to your own, local version of Ghostscript will yield a better PDF.
Download and Install
Visit http://www.pdfhacks.com/submit_file/ and download submit_file-1.0.zip. Unzip this archive, and then copy SubmitFile.exe to a convenient location. This is a simple program that uses the Windows WinInet API to submit a local file to a web server. It then opens the default web browser to view the server's response. The source code is available and you should consult it for HTTP submission details.
Install a ps2pdf.com Printer
The procedure for creating an Internet printer is the same as the procedure for creating the PDF printer in [Hack #39], except you don't need to install Ghostscript. The configuration is also a little different.
Follow the Print to PDF instructions, except:
- You don't need to install Ghostscript.
- Name the new printer ps2pdf.com Printer instead of GS Pdf Printer.
- Name the new Redirected Port RPTWEB: instead of RPTPDF:.
- When configuring this new Redirected Port, use the settings in Table below
-
RedMon port properties
Field
Value
Redirect this port to the program:
C:\redmon17\
RedRun.exeArguments for this program are:
C:\pdfhacks\
SubmitFile.exe/convert/convert.cgiwww.ps2pdf.cominputfile%1Output:
Program Handles Output
Run:
Minimized
- Name the Redirected Port log file C:\pdfhacks\web_printer.log instead of C:\gs\pdf_printer.log
- Click OK to accept the new port settings.
- Click OK to accept the new printer settings and close the dialog.
The RedRun program takes the PostScript print stream and creates a temp file for it. RedRun then runs the program SubmitFile, replacing the %1 with the temp filename. Note that you should not put quotes around this %1, because RedRun seems to pad the temp filename with whitespace that disrupts the SubmitFile arguments.
Test Your ps2pdf.com Printer
Open the ps2pdf.com Printer properties dialog, click the General tab, and click Print Test Page. When your PDF is ready for download from http://www.ps2pdf.com, a browser will open with a hyperlink to follow.
If an error occurs, check the log file for feedback from RedRun or SubmitFile.
Note that the previous configuration is tailored to the current state of http://www.ps2pdf.com. The site administrators might choose to alter it at any time, requiring you to change this printer's configuration.
1 comments:
Hi,
Now almost every printer will accept PDF files, the first important step toward a successful print job is sending your documents in the right format. Most online print providers have become adept at accepting a wide range of files—from microsoft word documents to bitmap images. Thanks a lot.
Post a Comment