User:Mrhsj/Sandbox/PDF Cleanup

From Wikipedia, the free encyclopedia

Portable Document Format (PDF)
Image:Adobepdfreader7 icon.png
File extension: .pdf
MIME type: application/pdf
Type code: 'PDF ' (including a single space)
Uniform Type Identifier: com.adobe.pdf
Magic: %PDF
Developed by: Adobe Systems

Portable Document Format (PDF) is a file format developed and published by Adobe Systems, for representing paginated electronic documents that may contain text, raster images, vector graphics and other types of content. The format was originally designed to insure that content reproduces consistently across computing platforms independently of the applications and resources available on the platform. It has been extended to serve many other purposes including the representation of electronic forms and 3D models.

PDF is the native file format of the Adobe Acrobat application and is the graphics metafile format for Mac OS X. Many software products implement some kind of support for the PDF format. Types of products that work with PDF are readers (programs used to view or print PDF) and converters (programs used to convert other file formats to PDF). A number of software products include a printer driver that emits PDF, as a way of enabling creation of PDF from any application that can print. [3]

Anyone may create applications that read and write PDF files without having to pay royalties to Adobe Systems; Adobe holds a number of patents relating to the PDF format but licenses them on a royalty-free basis for use in developing software that complies with its PDF specification.[1][2] Thus according to the broadest definitions of the term, PDF may be called an "open standard", because the format is publicly available, and anyone may implement it without restriction. But some definitions of openness require that a format be maintained by an independent non-profit organization; by this standard PDF is not open because Adobe controls the development of the format.

Contents

[edit] Common uses of PDF

Some common uses of PDF include

  • Distribution of electronic forms on the World Wide Web. This is particularly common with government agencies (such as the Internal Revenue Service) that have a requirement to make electronic forms look the same as paper forms.
  • Submission of advertisements to print publication. Time Inc. began requiring advertisements to be in PDF form in 2002. [4]
  • Electronic editions of academic journals, such as are stored on JSTOR.
  • Many courts accept PDF for electronic filing of legal documents.[5]
  • Long term preservation of government records. The National Archives accept PDF as one format for electronic document submission. [6]
  • PDF is a common format for digital maps.

[edit] History

[edit] Early Days

The origin of PDF is traced to 1991 when John Warnock of Adobe Systems wrote an internal paper The Camelot Paper suggesting that the technology of PostScript could be adapted to create portable documents and become part of the so-called paperless office. He called the new format "Interchange PostScript". The format was demonstrated in 1991 under that name, and launched in 1993 under the PDF brand along with Adobe Acrobat, which was the first commercial product to implement the format.[3]

Adoption was initially slow and Warnock had to fight within Adobe to keep PDF and Acrobat alive. There were competing formats such as Envoy, Common Ground Digital Paper, DjVu and even Adobe's own PostScript format (.ps). Adoption was limited by the price of Acrobat Reader, which was needed to view PDF files. Adobe made the Acrobat Reader free starting with version 2. And as the world wide web began to become popular, Adobe integrated the Reader with the Netscape browser. These two developments solved the problem of how to distribute PDFs and insure people could read them, and PDF adoption began to accelerate.[4]

[edit] Rapid Growth

Beginning with the launch of Acrobat 4.0, adoption of PDF increased rapidly. Besides the world wide web, some factors driving adoption were increased use of PDF in the print publishing industry, the integration of form fields into PDF documents, and the addition of XML representations for form data and metadata. [5] During this time the numnber of implementations of PDF software from companies other than Adobe (including an open source implementation, GhostScript) also increased rapidly.[citation needed]

[edit] Technical Overview

[edit] File Structure

A PDF file consists primarily of objects, of which there are eight types:[6]

  • Boolean values, representing true or false
  • Numbers
  • Strings
  • Names
  • Arrays, ordered collections of objects
  • Dictionaries, collections of objects indexed by Names
  • Streams, usually containg large amounts of data.
  • The null object

Objects may be either direct (embedded in another object) or indirect. Indirect objects are numbered with an object number and a generation number. An index table called the xref table gives the byte offset of each indirect object from the start of the file.[7] This design allows for efficient random access to the objects in the file, and also allows for small changes to be made without rewriting the entire file (incremental update).

Beginning with PDF version 1.5, indirect objects may also be located in special streams known as object streams. This technique reduces the size of files that have large numbers of small indirect objects and is especially useful for Tagged PDF.

[edit] Imaging Model

The basic design of how graphics are represented in PDF is very similar to that of PostScript, except for the use of transparency, which was added in PDF 1.4.

PDF graphics use a device independent Cartesian coordinate system to describe the surface of a page. A PDF page description can use a matrix to scale, rotate, or skew graphical elements. A key concept in PDF is that of the graphics state, which is a collection of graphical parameters that may be changed, saved, and restored by a page description. PDF has (as of version 1.6) 24 graphics state properties, of which some of the most important are:

[edit] Vector Graphics

Vector graphics in PDF, as in PostScript, are constructed with paths. Paths are usually made from of lines and cubic Bezier curves, but can also be constructed from the outlines of text. Unlike PostScript, PDF does not allow a single path to mix text outlines with lines and curves. Paths can be stroked, filled, or used for clipping. Strokes and fills can use any color set in the graphics state, including patterns.

PDF supports several types of patterns. The simplest is the tiling pattern in which a piece of artwork is specified to be drawn repeatedly. This may a colored tiling pattern, with the colors specified in the pattern object, or an uncolored tiling pattern, which defers color specification to the time the pattern is drawn. Beginning with PDF 1.4 there is also a shading pattern which draws continuously varying colors. There are seven types of shading pattern of which the simplest are the radial shade (Type 2) and axial shade (Type 3).

[edit] Raster Images

Raster images in PDF (called Image XObjects) are represented by dictionaries with an associated stream. The dictionary described properties of the image, and the stream contains the image data. (Less commonly, a raster image may be embedded directly in a page description as an inline image.) Images are typically filtered for compression purposes. Image filters supported in PDF include the general purpose filters

  • ASCII85Decode a deprecated filter used to put the stream into 7-bit ASCII
  • ASCIIHexDecode similar to ASCII85Decode but less compact
  • FlateDecode a commonly used filter based on the DEFLATE or Zip algorithm
  • LZWDecode a deprecated filter based on LZW Compression
  • RunLengthDecode a simple compression method for streams with repetitive data using the Run-length encoding algorithm

and the image-specific filters

  • DCTDecode a lossy filter based on the JPEG standard
  • CCITTFaxDecode a lossless filter based on the CCITT fax compression standard
  • JBIG2Decode a lossy or lossless filter based on the JBIG2 standard, introduced in PDF 1.4
  • JPXDecode a lossy or lossless filter based on the JPEG2000 standard, introduced in PDF 1.5

Normally all image content in a PDF is embedded in the file. But PDF allows image data to be stored in external files by the use of external streams or Alternate Images. Standardized subsets of PDF, including PDF/A and PDF/X, prohibit these techniques.

[edit] Text

Text in PDF is represented by text elements in page content streams. A text element specifies that characters in should be drawn at certain positions. The characters are specified using the encoding of a selected font resource.

[edit] Fonts

A font object in PDF is a description of a digital typeface. It may either describe the characteristics of a typeface, or it may include an embedded font file. The latter case is called an embedded font while the former is called an unembedded font. The font files that may be embedded are based on widely used standard digital font formats: Type 1 (and its compressed variant CFF), TrueType, and (beginning with PDF 1.6) OpenType. Additionally PDF supports the Type 3 variant in which the components of the font are described by PDF graphic operators.

[edit] Encodings

Within text strings characters are shown using character codes (integers) that map to glyphs in the current font using an encoding. There are a number of built-in encodings, including WinAnsi, MacRoman, and a large number of encodings for East Asian languages. (Although the WinAnsi and MacRoman encodings are derived from the historical properties of the Windows and Macintosh operating systems, fonts using these encodings work equally well on any platform.) The encoding mechanisms in PDF were designed for Type 1 fonts, and the rules for applying them to TrueType fonts are complex.

For large fonts or fonts with non-standard glyphs, the special encodings Identity-H (for horizontal writing) and Identity-V (for vertical) are used. With such fonts it is necessary to provide a ToUnicode table if semantic information about the characters is to be preserved.

[edit] Transparency

The original imaging model of PDF was, like PostScript's, opqaque: each object drawn on the page completely replaced anything previously marked in the same location. In PDF 1.4 the imaging model was extended to allow transparency. When transparency is used, new objects interact with previously marked objects to produce blending effects. The addition of transparency to PDF was done by means of new extensions that were designed to be ignored in products written to the PDF 1.3 and earlier specifications. As a result, files that use a small amount of transparency might view acceptably in older viewers, but files making extensive use of transparency could view completely wrong in an older viewer without warning.

The transparency extensions are based on the key concepts of transparency groups, blending modes, shape, and alpha. The model is closely aligned with the features of Adobe Illustrator version 9. The blend modes were based on those used by Adobe Photoshop at the time. When the PDF 1.4 specification was published the formulas for calculating blend modes were kept secret by Adobe. They have since been published.[8]

[edit] Interactive Elements

[edit] Logical Structure and Accessibility

[edit] Security and Signatures

[edit] Metadata

[edit] From here on is mostly old stuff

Proper subsets of PDF have been, or are being, standardized under ISO for several constituencies:

  • PDF/X for the printing and graphic arts as ISO 15930 (working in ISO TC130)
  • PDF/A for archiving in corporate/government/library/etc environments as ISO 19005 (work done in ISO TC171)
  • PDF/E for exchange of engineering drawings (work done in ISO TC171)
  • PDF/UA for universally accessible PDF files

[edit] Technology

PDF is primarily the combination of three technologies:

  • a sub-set of the PostScript page description programming language, for generating the layout and graphics,
  • a font-embedding/replacement system to allow fonts to travel with the documents, and
  • a structured storage system to bundle these elements and any associated content into a single file, with data compression where appropriate.

[edit] PostScript

Main article: PostScript

PostScript is a computer language — more precisely, a page description language — that is run in an interpreter to generate an image. This process requires a fair amount of resources.

PDF is a file format instead of a programming language and for that reason it doesn't need to be interpreted. For instance, flow control commands like if and loop are removed, while graphics commands such as lineto remain.

That means that the process of turning PDF back into a graphic is a matter of simply reading the description, rather than running a program in the PostScript interpreter. However, the entire PostScript world in terms of fonts, layout and measurement remains intact.

Often, the PostScript-like PDF code is generated from a source PostScript file. The graphics commands that are output by the PostScript code are collected and tokenized; any files, graphics or fonts the document references are also collected; and finally everything is compressed into a single file.

As a document format, PDF has several advantages over PostScript:

  • Single file: A PDF document resides in a single file, whereas the same document in PostScript may span multiple files (graphics, etc.) and probably occupies more space.
  • Already interpreted: PDF contains already-interpreted results of the PostScript source code, so it is less computation-intensive and faster to open, and there is a more direct correspondence between changes to items in the PDF page description and changes to the resulting appearance of the page.
  • Object transparency: PDF (starting from version 1.4) supports true transparency while PostScript does not.
  • Font substitution: If displayed with Adobe Reader, a font-substitution strategy ensures the document will be readable even if the end-user does not have the "proper" fonts installed. PDF also allows font embedding to ensure that the "proper" fonts are displayed. While this is possible with PostScript, such files cannot normally be distributed freely because of font licensing agreements.
  • Independent pages: PostScript is an imperative programming language (with an implicit global state), so instructions with one page can affect the appearance of any following page. It is therefore necessary to interpret all the preceding pages in order to determine the appearance of any given page. Each page in a PDF document is unaffected by any others.

[edit] History

When PDF first came out in the early 1990s, it was slow to catch on. At the time, not only did the only PDF creation tools of the time (Acrobat) cost money, but so did the software to view and print PDF files. Early versions of PDF had no support for external hyperlinks, reducing its usefulness on the web. Additionally, there were competing formats such as Envoy, Common Ground Digital Paper, DjVu and even Adobe's own PostScript format (.ps). Adobe soon started distributing the Acrobat Reader (now Adobe Reader) program at no cost, and continued to support PDF through its slow multi-year ramp-up. Competing formats eventually died out, and PDF became a well-accepted standard.

In 2005 Microsoft presented a similar fixed-layout document format named XML Paper Specification (XPS). XPS is based on XAML, and is distributed along a royalty-free license. XPS support is scheduled to be included in Microsoft Windows Vista.

[edit] Mac OS X

PDF was selected as the "native" metafile format for Mac OS X, replacing the PICT format of the earlier Mac OS. The imaging model of the Quartz graphics layer of Mac OS X is based on the model common to Display PostScript and PDF, and is sometimes somewhat confusingly referred to as Display PDF. Due to OS support, all OS X applications can create PDF documents automatically as long as they support the "print" command.

[edit] PDF and accessibility

One can create PDF files that are accessible to people with disabilities. Current PDF file formats can include tags (essentially XML), text equivalents, captions and audio descriptions, and other accessibility features. Some software, such as Adobe InDesign, can output tagged PDFs automatically. Leading screen readers, including Jaws, Window-Eyes, and Hal, can read tagged PDFs; current versions of the Acrobat and Acrobat Reader programs can also read PDFs out loud. Moreover, tagged PDFs can be reflowed and zoomed for low-vision readers.

However, many problems remain, not least of which is the difficulty in adding tags to existing or "legacy" PDFs; for example, if PDFs are generated from scanned documents, accessibility tags and reflowing are unavailable and must be created either by hand or using OCR techniques. Also, these processes themselves are often inaccessible to some people with disabilities. Nonetheless, well-made PDFs can be a valid choice as long-term accessible documents. The PDF/Universal Access Committee, an activity of AIIM, is working on a specification for PDF accessibility based on the PDF 1.6 specification.

Microsoft Word documents can be converted into accessible PDFs, but only if the Word document is written with accessibility in mind - for example, using styles, correct paragraph mark-up and "alt" (alternative) text for images, and so on.

[edit] PDF on the Web

Documents described in markup languages such as HTML/XHTML delegate responsibility for many display decisions to the renderer. This means that an XHTML document can render quite differently across various web browser platforms, adapting to the display device (screen/page size, visual or audio or braille rendering). However, even with a given output device and a document that fully specifies its fonts and sizes of borders etc., the appearance of an XHTML document will vary more than the appearance of a PDF document (because of various freedoms that the XHTML specification leaves to implementations: e.g. different font hinting choices lead to different word widths, which influence how many words fit on each line). The desire for greater control over user experience has led many authors to use the more rigid PDF specification to publish online content. This is particularly true for order forms, catalogues, brochures, and other documents which are primarily formatted for printing. The wide availability of Adobe Reader and easy-to-use WYSIWYG PDF authoring have further enticed many (mostly corporate) web authors to publish a wider variety of information as PDF.

Critics of this practice cite several reasons for avoiding it. The major one is that the inflexibility of PDF rendering makes it difficult to read on screen: it does not adapt to the window size nor the reader's preferred font size and font family, as classic XHTML web page does. PDF files tend to be significantly larger than XHTML/SVG files presenting the same information, making it difficult or impossible for users with low-bandwidth connections to view them. Adobe Reader, the de facto standard PDF viewer, has historically been slow to start and caused browser instability, particularly when run alongside other browser plugins (Adobe Reader 7 addressed many of these concerns, but is not available under Windows 98/ME). Adobe Reader is also unavailable in current versions on many alternative operating systems and is distributed under a proprietary license unacceptable to some users. During each major release of Adobe (Acrobat) Reader, the installer package gets significantly larger to support extra features, but users are left without means to selectively install components.

[edit] Searching for a text in a collection of files

Adobe Acrobat Reader 6.0 and above allow searching a collection of PDF files.

Using a search program to search for a text in a collection of files of different types, it may or may not be possible to also search PDF files, depending on the program. This is because the text is stored in coded form, and a program searching for some text must interpret the code and search the result, not just search the code.

Search programs that do not work include that of Windows XP (however does work once PDF iFilter from Adobe is installed) and Agent Ransack. However, for searching the Web, some search engines, such as Google and Yahoo!, include PDF files in searches. The option to view the PDF in HTML format is also commonly offered (this conversion does not include images).

Mac OS X, having PDF as a core element of the operating system, fully supports searching PDF files with the Preview application, used to view PDF files. The Spotlight feature in Mac OS X v10.4 extends this ability across the whole operating system, allowing information in PDF files to be found from a single search box.

On the Windows platform, text in PDF files can be searched Windows Desktop Search when installed with an appropriate iFilter available from Adobe Systems. Google Desktop can also be used for searching text in PDF files, but it only searches about the first 10,000 words of the pdf document. [7]

On the Linux and Unix platforms (and experimental Windows ports), the Beagle provides functionality similar to Apple's Spotlight, including text searching through the content of PDFs. The related program Dashboard (not to be confused with Apple's OS X Dashboard) also looks inside PDFs.

A PDF can only be searchable if it has either been created from an existing electronic document (Word, Excel, etc) containing text, or if a scanned document has been processed by optical character recognition (OCR), sometimes called 'captured' because of the names of components and products from Adobe.

[edit] Types of content

A PDF file of a map, for example, is often a combination of vector graphics, text, and raster graphics. A general reference map of the US [8] PDF (2.94 MiB) uses:

  • text stored as such — scalable, and also one can copy the text
  • vector graphics for coastlines, lakes, rivers, highways, markings of cities, and Interstate highway symbols — on zooming in, the curves remain clear, they do not appear as consisting of enlarged pixels (i.e. rectangles of pixels)
  • raster graphics for showing mountain relief — on zooming in, this consists of enlarged pixels

Some PDFs have no raster graphics at all. For example, see the Factbook's map of the Arctic PDF (521 KiB).

Tools exist, such as pdfimages (bundled with Xpdf) to extract the raster images from a PDF file. This can be useful if the PDF is a collection of scanned pages. Xpdf can also make raster images from complete pages that included vectors.

In later PDF revisions, a PDF document can also support links (inside document or web page), forms, JavaScript (initially available as plugin for Acrobat 3.0), or any other types of embedded contents that can be handled using plug-ins.

[edit] Usage restrictions and monitoring

PDFs may be encrypted so that a password is needed to view or edit the contents. The PDF Reference defines both 40-bit and 128-bit encryption, both making use of a complex system of RC4 and MD5. The PDF Reference also defines ways in which third parties can define their own encryption systems for use in PDF.

PDF files may also contain embedded digital restrictions that provide further controls that limit copying, editing or printing. The restrictions on copying, editing, or printing depend on the reader software to obey them, so the security they provide is very limited. Documents that are printable can be printed by using Microsoft Office Document Image Writer to create .mdi files. Image Writer has an OCR to Microsoft Word conversion option that seems to preserve tables and yields files that can be edited.

The PDF Reference has technical details or see [9] for an end-user overview. Like HTML files, PDF files may submit information to a web server. This could be used to track the IP address of the client PC, a process known as phoning home.

Through their LiveCycle Policy Server product, Adobe provides a method to set security policies on specific documents. This can include requiring a user to authenticate and limiting the time frame a document can be accessed or amount of time a document can be opened while offline. Once a PDF document is tied to a policy server and a specific policy, that policy can be changed or revoked by the owner. This controls documents that are otherwise "in the wild." Each document open and close event can also be tracked by the policy server. Policy servers can be set up privately or Adobe offers a public service through Adobe Online Services.

[edit] PDF hardware

With the increasing popularity of PDF, some printers also support direct PDF printing, which can interpret PDF data without external help. Currently, all PDF capable printers also support PostScript, but not all PostScript printers support direct PDF printing.

[edit] See also

[edit] References

  • Pfiffner, P. (2003). Inside the Publishing Revolution: The Adobe Story. Adobe Press. ISBN 0-321-11564-3
  • Adobe Systems, Inc. (2005). Adobe PDF Reference Guide, Fifth Edition version 1.6. Adobe Press. ISBN 0-321-30474-8
  1. ^ Adobe Legal Notices for Developers [1]
  2. ^ Adobe Systems p. 7
  3. ^ Pfiffner pp. 137-139
  4. ^ Pfiffner pp. 143-144, 195-196
  5. ^ Pfiffner pp. 198-202
  6. ^ Adobe Systems, p. 27
  7. ^ Adobe Systems, pp. 39-40
  8. ^ PDF Blend Modes Addendum [2]


[edit] Related formats

Category:Adobe Systems Category:Graphics file formats Category:Open formats Category:Page description languages Category:Vector graphics