Showing posts with label 2. PDF Management Tips. Show all posts
Showing posts with label 2. PDF Management Tips. Show all posts

Wednesday, March 26, 2008

How to Tally Topic Popularity

Organize PDF page hits by document headings to get a sense of what readers like best.

A single long document can cover dozens of topics. Which topics do readers find most useful? Use our PDF skins to track hits to individual pages. Then, use our hit_report script to map these page hits back into your document's headings. You'll see topic hits, not ambiguous page hits. Visit http://www.pdfhacks.com/eno/ for an example.

Page hit logging is built into the pdfskins_classic_php template. After unpacking this template, activate hit logging by editing script.include and setting $log_hits=true. You can do this at any time, before or after skinning your PDF. Page hits get logged into text files located in the same directory as the skinned PDF, so the web server must have write access to that directory.

If a page is named pg_0025.pdf, its hit log is named pg_0025.pdf.hits. Each hit adds one line to the file. Each line includes the IP number that requested the page, so you can identify unique visitors if you desire.

After skinning your PDF and making sure hit logging works, visit http://www.pdfhacks.com/skins/ and download hit_report.php-1.0.zip. Unpack this single PHP file and copy it onto your web server.

If your skinned PDF is located in the directory:

http://pdfhacks.com/eno/skinned_php/

pass its location to hit_report like so:

http://pdfhacks.com/hit_report.php?pdf=/eno/skinned_php

The document outline should appear in your browser, just as it does on the skinned PDF's title page. On the right side of the page, a column of numbers shows the number of hits on each outline topic.

For sections that span multiple pages, page hits are summed to create the section-hit count. However, section-hit counts do not include subsection-hit counts. If multiple sections have headings that appear on the same document page, those sections will also share the same hit count. hit_report identifies these by giving these sections the same background color.

Provide this hit information to your readers by merging hit_report features with the current skin templates index.html and index.toc.html.

Thursday, March 13, 2008

How to Customize Html Hyperlink to PDF Pages?

Take readers directly to the information they seek.

You can use HTML hyperlinks, those famous filaments of the Web, to integrate PDF documents with HTML documents. A simple link to a PDF document is not enough, though, because a single PDF might hold hundreds of pages. It is like handing a haystack to somebody searching for a needle. The solution is to modify the HTML link so that it takes the reader directly to the PDF page of interest. This kind of seamless integration of HTML and PDF pages requires some groundwork.

To tailor a hyperlink's PDF destination, just add one or more of the suffixes listed in below to the href path.

Open the PDF to page number N (the first page is 1)
page=N

Display PDF bookmarks
pagemode=bookmarks

Display PDF thumbnails
pagemode=thumbs

Conceal PDF bookmarks and thumbnails
pagemode=none

Conceal the Acrobat scrollbars
scrollbar=false

Conceal the Acrobat toolbar
toolbar=false

These are glued together and appended to the href path using a special notation. The first suffix follows a hash mark. Each additional suffix follows an ampersand. These options are fully documented in PDF Open Parameters, located at http://partners.adobe.com/asn/acrobat/sdk/public/docs/PDFOpenParams.pdf.

For example, to open mydoc.pdf to page 17 and display its document bookmarks, the hyperlink href would look like this:

http://pdfvault.com/mydoc.pdf#page=17&pagemode=bookmarks


These special PDF hyperlinks do not work when you're using Internet Explorer and the PDF is on your local disk.

Save Display Settings in the PDF
You can also save these display settings in the PDF file. Whenever and however the PDF is opened, it will be displayed according to your settings.

Friday, February 15, 2008

How to Copy Features from One PDF to Another?

Restore bookmarks, annotations, and forms after refrying your PDF.

You just refried your high-fidelity PDF to create a lightweight, online edition and Distiller burned off the nifty PDF navigation features and forms. Let's combine the old PDF's navigation features and forms with the new PDF's pages to get a lightweight, interactive PDF. Here's how:
  1. Open the old PDF file (the one with the bookmarks, links, or form fields) in Acrobat.
  2. In Acrobat 6, select Document >Pages >Replace. In Acrobat 5, select Document >Replace Pages from the menu.
  3. A file selector dialog opens. Select the new PDF file (the one with no PDF features).
  4. The Replace Pages dialog opens, requesting which pages to replace. Enter the first and last page numbers of your document.
  5. When it is done, select Save As . . . to save the resulting PDF into a new file.
  6. Test the resulting PDF to make sure all your interactive features came through successfully.
Using the Replace Pages feature like this to separate the visible page from its interactive features can be pretty handy. If you ever need to transfer a page and its interactive features, use the Extract Pages, Insert Pages, and Delete Pages functions.

Sunday, January 6, 2008

How to Print to Image and Other Rasterizing Options

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.

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. 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:

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

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

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

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

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.

"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.

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 %%.

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.

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. Open it in Photoshop, then Save As . . . to whatever format you want.

Mac OS X: Preview
Preview application that comes with Mac OS X lets you open PDF files and save them in a variety of graphics formats.

Thursday, January 3, 2008

How to Maximize PDF Portability?

PDF version differences can affect you and your readers.
To best serve your readers, you should ensure that your PDF is compatible with their viewers. What PDF viewers are they running? Assume that they have at least upgraded to the previous version of Acrobat/Reader (or another, compatible viewer). PDFs created with the newest Acrobat might be incompatible with previous versions.

PDF Versions Overview
With each new version of Acrobat, Adobe introduces an updated version of the PDF specification. They go together,
In many cases, an older viewer still can read a newer-version PDF (although the viewer will complain). Its behavior depends on which new features the PDF uses. Which viewers implement newer features? Here are some highlights, selected for their bearing on mass distribution. For complete details, consult the PDF Reference, Versions 1.3, 1.4, and 1.5.

PDF 1.3 (Acrobat 4) introduced:
  • Digital signatures
  • File attachments
  • JavaScript support
  • Logical page numbering

PDF 1.4 (Acrobat 5) introduced:
  • Additional 128-bit encryption option
  • Additional JavaScript trigger events (document close, will save, did save, will print, did print)
  • Enhanced interactive forms

PDF 1.5 (Acrobat 6) introduced:
  • Additional file compression options
  • Additional encryption options

An older viewer can simply ignore many of the things it doesn't understand. The showstoppers are the compression or encryption features, because the viewer can't show the document if it can't read the streams.

If your PDF relies on newer JavaScript or forms features to work properly, prevent older viewers from opening your PDF. Determine the minimum PDF version your document requires and then apply the corresponding encryption using an empty password. Older viewers simply won't be able to read it.

Create Compatible PDFs
Out of the box, Distiller or PDFMaker yields PDFs that are compatible with the previous version of Acrobat. No problem.

When you open a PDF in Acrobat, modify it, and then save it, your PDF's version is upgraded silently to match Acrobat's. It is no longer compatible with the previous versions of Acrobat/Reader. This happens regardless of whether your PDF uses any of the new features.

Install older versions of Acrobat Reader and test your PDFs, if you are worried about how they'll look or function. Download old installers from http://www.adobe.com/products/acrobat/reader_archive.html or http://www.oldversion.com/program.php?n=acrobat.

One solution is to use the Reduce File Size feature in Acrobat 6 (File Reduce File Size . . . Compatible with: Acrobat 5.0 and later), which enables you to also set the compatibility level of the resulting PDF. Another solution is to use the PDF Optimizer feature (Advanced PDF Optimizer . . . ) and set the "Compatible with" field to "Acrobat 5.0 and later." A third option is to refry your PDF.

Tuesday, January 1, 2008

Optimization for Acrobat Distiller Profile

Select the best Distiller profile for your purpose.
When you use Acrobat's "Print to PDF" or use the PDFMaker macro for Word, Adobe's Distiller is the engine that creates your PDF. What kind of PDF do you need? You can configure Distiller to create the best PDF for your purpose. The choice is usually between document fidelity and file size. File size becomes an issue only when distributing a PDF electronically. When in doubt, choose fidelity.

Changing the Distiller Profile
Acrobat Distiller comes with a few preconfigured profiles. They are also called Settings or joboptions files. When printing to PDF, change the profile by clicking the Print dialog's Properties button (Windows), or by selecting PDF Options from the drop-down box that starts out saying Copies & Pages (Mac). Select the Adobe PDF Settings tab and select a Distiller profile from the Default Settings: (Acrobat 6) or Conversion Settings: (Acrobat 5) drop-down box. This choice is not permanent. To change the default profile, consult the Adobe PDF (Acrobat 6) or Acrobat Distiller (Acrobat 5) printer properties.

When using PDFMaker on Windows, change its profile inside Word by selecting Adobe PDF Change Conversion Settings . . . (Acrobat 6) or Acrobat Change Conversion Settings . . . (Acrobat 5). This choice, shown in Figure 4-6, becomes the default.

When creating a PDF for a print shop or service bureau, ask them for a joboptions file to use. On Windows, move it to Distiller's Settings folder, which is located somewhere such as C:\Program Files\Adobe\Acrobat 5.0\Distillr\Settings\. On the Macintosh, open Distiller and use the Settings Add Adobe PDF Settings . . . menu option to add it to the list. Then, select the print shop or service bureau's profile when creating your PDF, as described earlier.

Tuesday, December 18, 2007

What is a multipurpose PDF?

You may want to try to give readers many editions in one package without tagging your PDF.

PDF makes a document portable by wrapping all its resources into a neat, single package. As people desire more features, more things get packed into the PDF. By attempting to make one file do all things for all people, that one file becomes large and unwieldy. Its portability begins to suffer.

In particular, Adobe has worked to add an information-oriented XML-ish layer on top of its presentation-oriented PDF features. The result is a single file that you can use for many purposes, such as paper printing, handheld reading, accurate text-to-speech, and accurate data extraction. However, creating these tagged PDFs is a slow and expensive process. The data layer is interwoven with the presentation layer, so accessing the data is difficult. Consequently, your readers have few options for utilizing this data. Finally, a tagged PDF file can grow to more than twice the size of its untagged counterpart.

In general, I advocate distributing a separate edition for each target medium. This is much easier on your readers and on your workflow. Eating sushi requires two chopsticks. Planar geometry requires five postulates. Some things shouldn't be reduced too far; don't feel compelled to make one edition do all things for all readers.

With that said, sometimes it makes sense to distribute multiple editions as a single PDF. For example, you might want to use PDF features such as encryption or digital signatures across all your editions. Instead of tagging your PDF, consider packing alternative editions into your PDF as attachments .

Candidates for attachments include the HTML edition, spreadsheet-ready document data, the handheld edition, or even the source document.

The concept of different attachments for different purposes makes more sense to readers than a single, shape-shifting (tagged) PDF. Also, they will immediately understand the benefits of each alternative edition. "HTML Edition" means reflowing text, easy data extraction, and easy text-to-speech. "Tagged PDF" means little to most people, so you might add: " . . . that acts like HTML sometimes. You own Acrobat, right?" You will have a struggle on your hands, assuming your reader has that much patience.

Thursday, November 29, 2007

How to quickly show the content of a group of PDF files in HTML page?

If you have some PDF files and you want your visitor able to browse its content you need to create a PDF document portal. This would enhance the experience of your visitor in your site, which enable the to browse the PDF file, without downloading once at a time.

Follow this procedure
1. Download pdftk and pdfportal
2. Extract the content to your PHP-enabled web serve
3. Edit pdfportal.config.php to refer the location of pdftk on your system.
4. Let's assume you copy the pdfportal files in http://localhost/pdfportal/ and the PDF files are located in http://localhost/PDFcollection/, view this directory using the portal, pass it to pdfdir.php with this path:

http://localhost/pdfportal/pdfdir.php?dir=/PDFcollection/

pdfdir.php calls pdftk's dump_data operation to create info files for every PDF in this directory, as needed. It then uses these plain-text info files to create an informative HTML summary page.

In this way you can very quickly display the name of your PDF files and when the user click on its title it would show the contents.

Monday, November 26, 2007

How to create PDF document portal in webpage?

PDF document portal in webpage, would allow you to display the PDF document based on its sections. It would greatly enhance the viewer's ability to select the best content based on their preference.
1. Download pdftk
2. Download pdfportal
3. Download pdftotext
3. Unzip pdfportal, copy the contents to your web server which support PHP
4. Edit pdfportal.config.php to refer the location of pdftk and pdftotext in your webserver
5. If you can't install pdftk or pdftotext on your web server, use pdftk and pdftotext on your local machine to create the necessary data files and then upload these data files to your web server. Read
pdfportal.config.php for details.
6. Let's assume the pdfportal files is copied in
http://localhost/pdfportal/ and the location of the PDF document is http://localhost/pdfportal/sample.pdf, use this path to view PDF using the portal by passing it to pdffile.php
http://localhost/pdfportal/pdffile.php?pdf=/collection/sample.pdf

pdffile.php tells pdftk to create http://localhost/collection/sample.pdf.info, if it isn't exist. pdffile.php then uses the converted plain-text info file to create an HTML page. An info file is simply the output from pdftk's dump_data operation

Open your PDF's document portal. If pdffile.php can find pdftotext on your computer (see pdfportal.config.php), it does two things. It uses pdftotext to convert your PDF into a plain-text file, and it activates its search interface. It stores the plain-text file in the same directory as the PDF file.

When you submit a search, pdffile.php scans this text file to discover which PDF pages contain your search terms. It reports search hits in reading order. If the PDF has bookmarks, these are used to organize the results. Click a link and the PDF opens to that page.

How to extract the keyword of your PDF documents?

Knowing your PDF keywords is important to write excerpts and descriptions of your documents. Large PDF document would make it hard for you to decide the best keyword for your PDF document.
Follow these procedures

1. Convert your PDF into a text file which would ease the keyword analysis, download xpdf.

2. Unzip, and copy pdftotext.exe to any folder you want. Macintosh OS X users can download a pdftotext installer here.

3. Run pdftotext from the command line, the command format of pdftext is the following

pdftotext input.pdf output.txt

4. Download the keyword extractor here, the downloaded file is 'kw_index-1.0.zip

5. Extract the file, use the following command format
kw_catcher {window size} {report style} {text input filename}


Window size= too small will make you miss the keyword, too high would result in high number of noise words (and, if, or....), try 12 as default, adjust accordingly.
Report Style= fill in with 'frequency'
text input filename= input file, the converted text file.

For example,
kw_catcher 12 frequency sample.txt

Sunday, November 25, 2007

How to create Windows shortcut for a PDF page?

Ordinary Windows shortcut only able to be directed to a specific PDF file, not to a specific PDF page. The ability to create a shortcut for a PDF page would certainly enhance your productivity.

Follow these steps,
1. In the Windows File Explorer menu, select Tools>Folder Options and then click the File Types tab.
2. Select the Adobe Acrobat Document (PDF) file type and click the Advanced button (in Windows XP and 2000) or the Edit button ( in Windows 98).
3. Double-click the Open action to change its configuration.
4. In the Edit Action Dialog for the Adobe Acrobat Document file type, fill in the values just like in the table below.

Field name

Field value

DDE Message

[DocOpen("%1")] [DocGoTo("%1",%2=0)]

Application

acroview

DDE Application Not Running


Topic

control


Photo Sharing and Video Hosting at Photobucket

Based on the DDE message, Acrobat opens the PDF file initially at the first argument (%1) and then to go to the page in the second argument (%2). If %2 is not available, Acrobat will open the PDF in the first page (page zero).

Click OK, OK, and Close, and you are now have a shortcut for a specific PDF page.

Saturday, November 24, 2007

How to enable specific page bookmarking to online PDF?

Web browsers are normally unable to bookmark online PDF pages, use this tips to fix that.
  • Goto http://www.pdfhacks.com/shortcuts/ , download shortcuts-1.0.zip.
  • Extract and copy 'shortcuts.api' file to the Acrobat's plug_ins folder. The folder is usually located in C:\Program Files\Adobe\Acrobat 5.0\Acrobat\plug_ins\
  • Restart Acrobat
  • There would be a submenu in Acrobat Plug-Ins menu and a new button called 'Create Shortcut to This Page' in the navigation toolbar
How to use this new feature?
When you find the PDF page you like, click the new button and an internet shortcut would appear in the bookmark folder of your browser. When you activate this bookmark, the web browser will automatically goto the specific page of an online PDF, instead go to the front page of the online PDF file.

You can convert this bookmark to Mozilla by selecting File>Export and Import in Internet Explorer.
However if the browser unable to display the bookmarked page after you run the bookmark, try these tips.
  • In Internet Explorer, your browser should be configured to open shortcut in new window configure by opening Tools Internet Options . . . Advanced and then removing the checkmark next to the "Reuse windows for launching shortcuts" option.
  • On Mozilla, click the Reload button or select View Reload after you activate a shortcut.

Friday, November 23, 2007

How to add bookmark capability in Acrobat Reader?

Web browsers have the ability to bookmark PDF pages, yet curiously Acrobat Reader does not have that capability.
Download the javascript file called 'bookmark_page.js' here
Extract the file and put into the javascript folder at your Acrobat installation directory.

How to use this new feature?
1. When you find the PDF page you want to bookmark, press the three keys combination (Alt V 5)
2. To call for a bookmarked page use the three keys combination, (Alt V 6)
3. To delete a bookmark, select View>Remove Bookmark, you will be given a list of bookmarks, delete any bookmark you want.