Pdf Hacks Free Open Book

Pdf Hacks

Origami Paper Planes
Paper Airplane Origami Boats. Learn hot to flod this crafts
Previous Section  < Day Day Up >  Next Section

Hack 45 Print to Image and Other Rasterizing Options

figs/expert.gif figs/hack45.gif

Thumbnail the cover or rasterize the entire document.

You might sometimes need to convert PDF to other graphics formats. You can easily add a "Print to Image" printer by following [Hack #39] and changing a few ingredients. Alternatively, rasterize your PDF documents using Adobe Acrobat or Photoshop. Because Photoshop gives you the most power, you might prefer to "Print to PDF" and then open these pages in Photoshop.

4.15.1 Install a PNG (or JPEG or TIFF) Printer

The procedure for creating a bitmap (e.g., TIFF, JPEG, PNG) printer is the same as the procedure for creating the PDF printer in [Hack #39] . The configuration is just a little different. In this example, we'll configure a PNG printer, but you just as easily can create a JPEG or TIFF printer. The DEVICE option determines what gets created. We discuss alternative devices a little later.

Follow the PDF Printer instructions, except:

  1. Name the new printer GS png16m Printer instead of GS Pdf Printer.

  2. Name the new Redirected Port RPTPNG16M: instead of RPTPDF:.

  3. When configuring this new Redirected Port, name the options file C:\gs\png16m_printer.cfg instead of C:\gs\pdf_printer.cfg.

  4. When configuring this new Redirected Port, name the log file C:\gs\png16m_printer.log instead of C:\gs\pdf_printer.log.

  5. Create the file png16m_printer.cfg, referenced earlier. It is a text file of additional arguments passed to Ghostscript. An example is included with our Virtual Printer Kit. Change the paths to suit your Ghostscript and system setup.

    -dSAFER
    
    -dBATCH
    
    -dNOPAUSE
    
    -Ic:\gs\gs8.14\Resource
    
    -Ic:\gs\fonts
    
    -Ic:\gs\gs8.14\lib
    
    -sFONTPATH=c:\WINDOWS\FONTS
    
    -sDEVICE=png16m
    
    -r72
    
    -dTextAlphaBits=4
    
    -dGraphicsAlphaBits=4
    
    -dAlignToPixels=0

    Using this procedure, you can create one printer for each image file format you commonly use.

4.15.1.1 "Print to Image" devices and options

The documentation that comes with Ghostscript (C:\gs\gs8.14\doc\index.htm) explains the available output devices (Devices.htm) and general options (Use.htm) that you can use in the configuration file. Tables Table 4-8 and Table 4-9 provide a quick, abbreviated reference to give you a glimpse of what's possible.

Table 4-8. Some Ghostscript bitmap devices

Ghostscript device

Description

pnggray

Grayscale PNG

png16

16-Color (4-bit) PNG

png256

256-Color (8-bit) PNG

png16m

16-Million Color (24-bit) PNG

jpeggray

Grayscale JPEG

jpeg

Color JPEG

tiff24nc

16-Million Color (24-bit) TIFF

faxg3

G3 Fax with EOLs


Table 4-9. Some Ghostscript bitmap options

Ghostscript option

Description

-r<dpi resolution>

Sets the resolution of the output file in dots per inch. Screen resolution is commonly 72 dpi. To create thumbnails, set this to a low value, such as 20 dpi.

-dTextAlphaBits=<1|2|4>

Sets the text antialiasing. 4 yields the greatest smoothing.

-dGraphicsAlphaBits=<1|2|4>

Sets the graphics antialiasing. 4 yields the greatest smoothing.

-dJPEGQ=<0-100>

Sets the JPEG quality. Lower values yield greater compression at the expense of image quality.


4.15.1.2 Image output filenames

When printing a multipage document to one of these bitmap printers, the output filename must include the %d page number variable so that each page gets a unique filename. To pad this variable with three leading zeros, use %03d. On the Windows command line, the % must be represented by %%. Here are some example filenames that you might enter into the Save As . . . dialog box:


report_page-%d.png

Yields: report_page-1.png, report_page-2.png, . . .


book_pg-%03.png

Yields: book_pg-001.png, book_pg-002.png, . . .


tome_p-%04.png

Yields: tome_p-0001.png, tome_p-0002.png, . . .

4.15.2 Acrobat: Save As Image

Beginning with Acrobat 5, you can open a PDF and then Save As . . . to JPEG, PNG, or TIFF image files. From the Save As . . . dialog, click the Settings . . . button to configure image options. You can set the image resolution, color space, and compression, among other things.

4.15.3 Photoshop: Open PDF

Photoshop is an ideal place to manipulate bitmaps, so it makes sense to open your PDF right in Photoshop. If your original document isn't a PDF, print one using Acrobat Distiller or our GS Pdf Printer [Hack #39] . Open it in Photoshop, then Save As . . . to whatever format you want.

4.15.4 Mac OS X: Preview

As mentioned in [Hack #2], the Preview application that comes with Mac OS X lets you open PDF files and save them in a variety of graphics formats.

    Previous Section  < Day Day Up >  Next Section
    Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][L][M][N][O][P][Q][R][S][T][U][V][W][X][Z]

    Origami Paper AirPlane
    Paper Airplane Origami Boats

         Main Menu
    PDF Hacks
    Table of Contents
    Copyright
    Credits
    Preface
    Chapter 1. Consuming PDF
    Chapter 2. Managing a Collection
    Chapter 3. Authoring and Self-Publishing: Hacking Outside the PDF
    Chapter 4. Creating PDF and Other Editions
    Introduction: Hacks #32-50
    Hack 32 Create Interactive PDF with Your Word Processor
    Hack 33 Create a Printable, On-Screen Edition from Word
    Hack 34 Multipurpose PDF
    Hack 35 Create an HTML Edition from Your Word Processor
    Hack 36 Create a Handheld Edition from Your HTML
    Hack 37 Convert Documents from Tools You Don't Own to PDF
    Hack 38 Acrobat Distiller and Its Profiles
    Hack 39 Print to PDF with Ghostscript and RedMon on Windows
    Hack 40 Save As PDF with Mac OS X
    Hack 41 Maximize PDF Portability
    Hack 42 Configure Distiller and Ghostscript for Your Purpose
    Hack 43 Embed and Subset Fonts to Your Advantage
    Hack 44 Share a PDF Network Printer with Samba
    Hack 45 Print to Image and Other Rasterizing Options
    Hack 46 Print to SVG
    Hack 47 Print Over the Internet
    Hack 48 Create a PDF Album of Your Digital Pictures
    Hack 49 Print to Fax on Windows
    Hack 50 Convert Incoming Faxes to PDF on Linux
    Chapter 5. Manipulating PDF Files
    Chapter 6. Dynamic PDF
    Chapter 7. Scripting and Programming Acrobat
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplane
    Paper Airplane - Paper Airplane - Paper Airplane - Paper Airplane - Paper Airplane - Paper Airplane - Paper Airplane - Paper Airplane -