Penguin
Blame: CreatingPDFs
EditPageHistoryDiffInfoLikePages
Annotated edit history of CreatingPDFs version 23, including all changes. View license author blame.
Rev Author # Line
20 AristotlePagaltzis 1 !!! Under [Linux]
18 AristotlePagaltzis 2
3 !! From any PostScript document
4
5 Many applications are capable of generating PostScript. Since [PDF] is actually a container format that relies on PostScript for the actual document image, generating [PDF]s from PostScript documents is trivial. The GhostScript package processes both formats and comes with a script called ps2pdf(1) ([Debian] package: __gs-common__) which does exactly what its name suggests. Older versions of GhostScript (such as the widely used version 5.50) embed any non-core fonts as bitmap fonts, which AcrobatReader doesn't do a very good job of rendering. More recent versions of GhostScript (6.x or 7.x) do a much better job of embedding scalable fonts in the document.
6
19 JohnMcPherson 7 See the notes below for hints about using ps2pdf/ghostscript.
18 AristotlePagaltzis 8
9 !! As a special printer
10
11 You can set up a fake printer that will generate a [PDF] file. Most of these techniques are wrappers to ps2pdf. This means you can make a [PDF] file from any program that can print. See the [SambaPDFPrinter] and [CUPSNotes] pages.
12
13 !! From [LaTeX] documents
14
15 You can use [LaTeX] to make good quality [PDF] files: PdfLatexNotes or LaTeXpdf are good places to look.
16
17 !! From OpenOffice
18
19 Version 1.0 of OpenOffice allows you to set up a special [PDF] printer. From the correct installation directory (such as __/usr/lib/openoffice/program__), run __./spadmin__, select ''New Printer'' and then ''Connect a PDF converter'' and then OpenOffice will see its own special extra printer. Debian has a wrapper script called __oopadmin__ that you can run from any directory.
20
22 JohnMcPherson 21 Version 1.1 of ~OpenOffice does [PDF] "natively" - it is merely another filetype you can save as, rather than setting up fake printers. It also has ''Export to PDF...'' which allows you to save optimised for ''Size'', ''Print'', or ''Press''.
18 AristotlePagaltzis 22
22 JohnMcPherson 23 __Hint__: ~OpenOffice will embed TrueType fonts into the PDF file it creates. You may get better results if you use fonts with the same name as the "core" fonts built into the PDF file format. For example, use "Times" instead of "Times New Roman" for your serif font, "Helvetica" as your sans-serif font, and "Courier" as your monotype font. If you do this, then no font information needs to be embedded in the PDF (which some viewers might have problems with), and the PDF file is smaller as a result.
19 JohnMcPherson 24
25 ----
26 !!ps2pdf hints
27
28 * ps2pdf is really just a wrapper script that calls gs(1) with the correct options, such as -sDEVICE=pdfwrite (meaning to use the "pdfwrite" output device). Make sure you are using the most recent version of GNU ghostscript, since each version seems to improve greatly on previous versions. (Current version in debian testing at time of writing is 7.07).
23 JohnMcPherson 29 * If you are trying to make a pdf from a postscript file that has a funny size (ie, using "gv" shows it is using the BoundingBox), use the __"-dEPSCrop"__ option. Otherwise it will default to landscape A4 and probably things wrong. Or you could try the ''epstopdf'' wrapper script (part of [LaTeX]).
22 JohnMcPherson 30 * If your document is black-and-white/grayscale, you might be able to make use of some optimisations by adding __"-dProcessColorModel=/~DeviceGray"__ as a command-line option.
19 JohnMcPherson 31 * You can add a -r''<n>'' option for the resolution... eg a low resolution like -r75 if you are only creating a PDF designed to be viewed on-screen.
23 JohnMcPherson 32 * Apparently, the default options for ghostscript's "pdfwrite" device changed with ghostscript 7, and it now defaults to using DCT/[JPEG] compression on images, which isn't very good for screenshots or other low-res images. Add the
33 <pre>
34 __-dColorImageFilter=/~FlateEncode -dAutoFilterColorImages=false__
35 </pre>
36 and/or
37 <pre>__-dGrayImageFilter=/~FlateEncode -dAutoFilterGrayImages=false__
38 </pre>
39 options to your ps2pdf/gs command.
19 JohnMcPherson 40 * You can join (ie concatenate) multiple PostScript and PDF files together, for example:
22 JohnMcPherson 41 <verbatim>
19 JohnMcPherson 42 gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
43 -sOutputFile=/tmp/merged.pdf file1.ps file2.pdf file3.pdf ...
22 JohnMcPherson 44 </verbatim>
18 AristotlePagaltzis 45 ----
46
47 !!! Under [Windows]
48
49 !! OpenOffice
50 The windows version of OpenOffice will work, as discussed above.
51
52 !!Via a special Printer Queue
53 The [SambaPDFPrinter] described above can almost certainly be shared via samba and printed to from Windows Applications, something similar can probably be done for the CUPS version mentioned above as well. If I ever get around to setting this up I'll wiki the results.
54
55 [PDF-creator|http://sourceforge.net/projects/pdfcreator/] is a special
22 JohnMcPherson 56 PDF printer driver for Windows, based on GhostScript. (Released under [GPL]). This method has an advantage over the other [Free] methods in that it allows you to set access/print/copy permissions on the generated PDF. One disadvantage is that it must be installed by an Administrator. (In contrast, you can install and run OpenOffice as a normal windows user.)
18 AristotlePagaltzis 57
58 !! From Word documents
59
60 If you don't have any PDF software installed (either [Adobe] or other), and just want to convert a Word document to PDF, there's an easy-to-use service at [http://www.fastpdf.com]. You upload your document, and enter your email address, and the service sends you a note when the conversion is done. (You then pick up the conversion from the website.) The service is free for short documents, and relatively inexpensive for longer docs ('much' cheaper than purchasing Adobe's software!). Note: this is a somewhat shameless plug (since I built the thing), but many people do find it convenient.
61
62 As with any PDF conversion service, Fast PDF can get confused by unusual fonts found in Word docs. But if you embed the fonts you use in your document prior to submitting it to the service, the service works very well.
63
22 JohnMcPherson 64 __ Note:__ Anyone considering using the above website should be aware of the following from the terms of service::
65 ''You acknowledge and agree that Fast PDF, LLC may at its discretion insert advertising material into the file or files resulting from the conversion process.''
66 In practice, the service adds a ''Converted at Fast PDF'' watermark in the margins of conversions done for free (but not those paid for).
18 AristotlePagaltzis 67
68 !! [PDF]s with [Macron]s from Word documents
69
70 This can be a problem when the document contains [Macron]s and other characters not in all the standard character sets. The following technique appears to work at least in some cases where you have a PostScript printer visible and [Adobe] PDFWriter installed.
71
72 # Open the document in Word
73 # From the ''File / Print...'' dialog, select a PostScript printer and check the ''Print to file'' checkbox
74 # Hit Ok and supply a filename to save the .prn file with
75 # Open Notepad, and open the .prn in Notepad (not by double clicking it)
76 # The first line of the .prn should be quite long and contain lots of junk. Delete everything up to the "%!PS-Adobe-3.0". These must be the first characters in the file.
77 # Save the result as a .ps file
78 # Double clicking on the .ps file should launch [Adobe] PDFWriter to automatically create a [PDF]
79
80 The [PDF] file will almost certainly look dreadful because all the fonts that make things look nice on the screen got thrown away in the ''Print to file'' step. It should print nicely however.
81
82 For those without the budget for the full Acrobat, you can use the ps2pdf(1) program from GhostScript mentioned in the Linux section above.
83
84 !! From Publisher, for online publishing
85
86 You can use the ''MS Imagesetter Printer'' that is created by the ''Commercial Printer'' option when installing Publisher. This creates a pair of pseudo-printers on a [Windows] box, which can be used to ''Print to file'' if the app doesn't support such. The printers are called ''MS Publisher Colour Printer'' and ''MS Publisher Imagesetter'' and both are capable of colour. The Imagesetter one seems to work better.
87
88
89 ----
90
91 !!! Under [MacOSX]
92
93 The following have been tested under OSX 10.3 (Panther) only; someone else might want to confirm them on earlier versions.
94
22 JohnMcPherson 95 * From most applications (Safari, iCal, ~TextEdit and Preview etc...), you can select ''Print'' from the ''File'' menu and click on the ''Save As PDF...'' button and select your destination for your [PDF].
18 AristotlePagaltzis 96 * From ''Preview'', you can also select ''Export'' from the ''File'' menu, select [PDF] from the ''Format'' pulldown menu and select your destination for your [PDF].
21 JohnMcPherson 97
98 ----

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 4 times)