<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc='yes' ?>     <!-- add table of contents -->
<?rfc editing='yes' ?> <!-- paragraph numbering -->
<?rfc symrefs='yes' ?> <!-- use references like [ABC] instead of [1] -->
<?rfc sortrefs='no'?>  <!-- sort the references alphabetically -->
<?rfc linkmailto='no'?>
<?rfc compact='yes'?>
<?rfc comments='yes'?> <!-- print crefs -->
<?rfc inline='yes'?>
<?rfc-ext parse-xml-in-artwork='yes' ?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<rfc docName="draft-hardy-pdf-mime-03" category="info" obsoletes='3778'>
  <front>
    <title abbrev="application/pdf">The application/pdf Media
    Type</title>
    <author initials="M." surname="Hardy" fullname="Matthew Hardy">
      <organization>Adobe</organization>
      <address>
	<postal>
	  <street>345 Park Ave</street>
	  <city>San Jose</city>
	  <region>CA</region>
	  <code>95110</code>
	  <country>USA</country>
	</postal>
	<email>mahardy@adobe.com</email>
      </address>
    </author>
    <author initials="L." surname="Masinter" fullname="Larry Masinter">
      <organization>Adobe</organization>
      <address>
	<postal>
	  <street>345 Park Ave</street>
	  <city>San Jose</city>
	  <region>CA</region>
	  <code>95110</code>
	  <country>USA</country>
	</postal>
	<email>masinter@adobe.com</email>
	<uri>http://larry.masinter.net</uri>
      </address>
    </author>
    <author initials="D." surname="Markovic" fullname="Dejan Markovic">
      <organization>Adobe</organization>
      <address>
        <postal>
          <street>345 Park Ave</street>
          <city>San Jose</city>
          <region>CA</region>
          <code>95110</code>
          <country>USA</country>
        </postal>
        <email>dmarkovi@adobe.com</email>
      </address>
    </author>
    <author initials="D." surname="Johnson" fullname="Duff Johnson">
      <organization>PDF Association</organization>
      <address>
	<postal>
	  <street>Neue Kantstrasse 14</street>
	  <city>Berlin</city>
	  <code>14057</code>
	  <country>Germany</country>
	</postal>
	<email>duff.johnson@pdfa.org</email>
      </address>
    </author>
    <author initials="M." surname="Bailey" fullname="Martin Bailey">
      <organization>Global Graphics</organization>
      <address>
	<postal>
	  <street>2030 Cambourne Business Park</street>
	  <city>Cambridge</city>
	  <code>CB23 6DW</code>
	  <country>UK</country>
	</postal>
	<email>martin.bailey@globalgraphics.com</email>
	<uri>http://www.globalgraphics.com</uri>
      </address>
    </author>
    <date/>
    <keyword>Requests for Comment</keyword>
    <abstract>
      <t>
	The Portable Document Format (PDF) is an ISO standard (ISO
	32000-1:2008) defining a final-form document representation
	language in use for document exchange, including on the
	Internet, since 1993.  This document provides an overview of
	the PDF format and updates the media type registration of
	<spanx style="verb">application/pdf</spanx>.
      </t>
    </abstract>
  </front>
  <middle>
    <section title='Introduction'>
      <t>
	This document is intended to provide updated information
	on the registration of the MIME Media Type
	<spanx style="verb">application/pdf</spanx> for documents defined in the PDF <xref
	target='ISOPDF'/>, "Portable Document Format", syntax.
      </t>
      <t>
	PDF was originally envisioned as a way to reliably communicate
	and view printed information electronically across a
	wide variety of machine configurations, operating
	systems, and communication networks.
      </t>

      <t>
	PDF is used to represent "final form" formatted documents.
	PDF pages may include
	text, images, graphics and multimedia content such as
	video and audio.  PDF is also capable of containing
	auxiliary structures including annotations,
	bookmarks, file attachments, hyperlinks, logical
	structure and metadata.  These features are useful for
	navigation, building collections of related documents and for
	reviewing and commenting on documents.  A rich JavaScript
	model has been defined for interacting with PDF documents.
      </t>

      <t>
	PDF used the imaging model of the
	PostScript <xref target="PS"/> page description language
	to render complex text, images, and graphics in a device
	and resolution-independent manner. 
      </t>

      <t>
	PDF supports encryption and digital signatures.  The
	encryption capability is combined with access control
	information to facilitate management of the
	functionality available to the recipient.  PDF supports
	the inclusion of document and object-level metadata through
	the eXtensible Metadata Platform<xref target='XMP'/>.
      </t>
      <!-- 
	Additionally, PDF reduces the
	complexity of processing content to improve performance
	for interactive viewing.  In addition to the rendering
	capabilities, PDF also includes objects, such as
	hypertext links and annotations, that are not part of
	the page itself, but are useful for navigation, building
	collections of related documents and for reviewing and
	commenting on documents.
      -->

    </section>
    <section title='History'>
      <t>
	PDF is used widely in the Internet community.  The first
	version of PDF, 1.0, was published in 1993 by Adobe
	Systems.  Since then PDF has grown to be a
	widely-used format for capturing and exchanging
	formatted documents electronically across the Web, via
	e-mail and virtually every other document exchange
	mechanism.  In 2008, PDF 1.7 was published as an ISO
	standard <xref target='ISOPDF'/>, ISO 32000-1:2008.
      </t>
      <t>
	The ISO TC-171 committee is presently working on a
	refresh of PDF, known as ISO 32000-2, with a version
	of PDF 2.0, expected to be published in 2017.
      </t>
      <t>
	In addition to ISO 32000-1:2008 and 32000-2, 
	several subset standards have been defined to
	address specific use cases and standardized by
	the ISO.  These standards include PDF
	for Archival (PDF/A), PDF for Engineering (PDF/E), PDF
	for Universal Accessibility (PDF/UA), PDF for Variable
	Data and Transactional Printing (PDF/VT) and PDF for
	Prepress Digital Data Exchange (PDF/X).  The subset
	standards are fully compliant PDF files capable of being
	displayed in a general PDF viewer.
      </t>
    </section>
    <section title='Fragment Identifiers' anchor='fragments'>
      <t>
	A set of fragment identifiers <xref target='RFC3986'/> and
	their handling are defined in ISO 32000-2 <xref
	target="ISOPDF2"/>.  This section summarizes that material;
	any disagreements between that document and this should be
	resolved in favor of the ISO definition, once that has been
	approved.
      </t>
      <t>
        A fragment identifier is comprised of one or more
        parameters separated
        by the AMPERSAND (&amp;)  character.  Each
        parameter implies an action to be performed on the
        document and provides values to be used for that
        action; the values for a parameter are introduced
        by an EQUAL SIGN (=) and separated by a COMMA (,);
	values which are strings appear in the fragment
	identifier using URI's percent-hex escaping --
	spaces, reserved and non-ASCII strings are 
	included by %nn encoding the UTF-8 of each character.

        Actions shall be processed and executed from left to
        right as they appear in the character string that
        makes up the fragment identifier.
      </t>
      <t>
	The parameters listed in this section
	operate on the document at the point it is opened;
	for this reason they are sometimes referred to as
	PDF open parameters.  The fragment identifier should
	be processed immediately after document-specified open
	parameters have been processed.
      </t>
      <t>
        The table below lists the PDF open parameters relevant
        to PDF.  All coordinate values (left, right, top, and
        bottom) are expressed in the default user space
        coordinate system (1/72 of an inch measured down
	and to the right from the upper-left corner); see
	<xref target="ISOPDF" /> Section 8.3.2.3 "User Space".
      </t>
      <texttable>
        <preamble>
          PDF Open Parameters
        </preamble>
        <ttcol>Parameter Name</ttcol>
        <ttcol>Arguments</ttcol>
        <ttcol>Description</ttcol>
        <c>
          <spanx style="verb">nameddest</spanx>
        </c>
        <c>
          <spanx style="emph">name</spanx>
        </c>
        <c>
          Open the document to the specified named
          destination.  The argument provided is a string
          which shall correspond to the name of a destination
          in the target document.
        </c>
        <c>
          <spanx style="verb">page</spanx>
        </c>
        <c>
          <spanx style="emph">pageNum</spanx>
        </c>
        <c>
          Open the document to the specified page number.  The
          argument shall be a positive integer number.  The
          first page in the document has a pageNum value of 1.
        </c>
        <c>
          <spanx style="verb">zoom</spanx>
        </c>
        <c>
          <spanx style="emph">scale
          scale,left,top</spanx>
        </c>
        <c>
          Open the document with the specified zoom level and
          optional offset.  The scale argument shall be either
          an integer or floating point value representing the
          percentage to which the document should be zoomed,
          where a value of 100 would correspond to a zoom of
          100%.  The left and top arguments are optional, but
          shall both be specified if either is included.  The
          left and top arguments shall be integer or floating
          point values representing the offset from the left
          and top of the page in a coordinate system where 0,0
          represents the top left corner of the page.
        </c>
        <c>
          <spanx style="verb">view</spanx>
        </c>
        <c>
          <spanx style="emph">keyword,position</spanx>
        </c>
        <c>
          Open the document with the specified destination set
          as the view.  The arguments shall correspond to
          those found in <xref target='ISOPDF2'/> 12.3.2.2,
          "Explicit destinations". The keyword shall correspond
          to one of the keywords defined in <xref target='ISOPDF2'/>
          Table 149, "Destination syntax" with appropriate position
          values.
        </c>
        <c>
          <spanx style="verb">viewrect</spanx>
        </c>
        <c>
          <spanx style="emph">left,top,width,height</spanx>
        </c>
        <c>
          Open the document with the specified window view
          rectangle.  The left and top arguments shall be
          integer or floating point values representing the
          offset from the left and top of the page in a
          coordinate system where 0,0 represents the top left
          corner of the page.  The width and height arguments
          shall be integer or floating point values
          representing the width and height of the view.
        </c>
        <c>
          <spanx style="verb">highlight</spanx>
        </c>
        <c>
          <spanx style="emph">left,right,top,bottom</spanx>
        </c>
        <c>
          Open the document with the specified rectangle
          highlighted.  Each argument shall be an integer or
          floating point value representing the rectangle
          measured from the top left corner of the page.
        </c>
        <c>
          <spanx style="verb">structelem</spanx>
        </c>
        <c>
          <spanx style="emph">structID</spanx>
        </c>
        <c>
          Open to the page on which the first content item, 
		  hierarchically contained within the structure element 
		  identified by the structure ID, is located.  If no 
		  content is contained within the hierarchy of the 
		  structure element or the ID does not match a structure 
		  element, the page number shall be treated as the first 
		  page within the document.  The structID shall be a byte 
		  string with URI encoding that will be matched to the ID
		  key within a StructElem dictionary.
        </c>
        <c>
          <spanx style="verb">comment</spanx>
        </c>
        <c>
          <spanx style="emph">commentID</spanx>
        </c>
        <c>
          Open the document with the specified comment
          selected.  The commentID shall be the value of an
          annotation name, which is defined by the NM key in
          the corresponding annotation dictionary (see 12.5.2
          "Annotation dictionaries", Table 167).
          
          If the comment parameter is combined with another
          parameter that defines a specific page to be
          displayed, then the comment parameter shall appear
          after that in the URI.
          
          Note: The NM key is unique to a specific page, but
          is not guaranteed to be unique to a document.
          Unless the page on which the comment resides has
          been selected prior to the comment parameter, the
          comment will not be selected.
        </c>
        <c>
          <spanx style="verb">search</spanx>
        </c>
        <c>
          <spanx style="emph">wordList</spanx>
        </c>
        <c>
          Open the document and search for one or more words,
          selecting the first matching word in the document.
          The wordList argument defines the search words and
          shall be a string enclosed within quotation marks
          comprised of individual words separated by space
          characters.
          
          Note that the space characters must be encoded.
        </c>
        <c>
          <spanx style="verb">fdf</spanx>
        </c>
        <c>
          <spanx style="emph">URI</spanx>
        </c>
        <c>
          Open the document and then import the data from the
          specified FDF or XFDF file (see <xref target='ISOPDF'/>
	  Section 12.7.8).  The URI shall be either
          a relative or absolute URI to an FDF or XFDF file.
          
          The fdf parameter should be specified as the last
          parameter to a given URI.
          
          Note: The fdf parameter is recommended to be the
          last parameter so that the document can open
          directly to the appropriate view.
        </c>
        <c>
          <spanx style="verb">ef</spanx>
        </c>
        <c>
          <spanx style="emph">name</spanx>
        </c>
        <c>
          Open the embedded file contained within the EmbeddedFiles
		  name tree identified by the name.  The name argument shall
		  be a byte string used to match a file specification dictionary
		  in the EmbeddedFiles name tree.
        </c>
      </texttable>
    </section>
    
    <section title='Subset Standards'>
      <t>
        Several subsets of PDF have been published as distinct ISO standards:
        <list style="symbols">
          <t>
            PDF/X, initially released in 2001 as PDF/X-1a <xref
            target='ISOPDFX'/>, specifies how to use PDF for graphics
            exchange, with the aim to fascilitate correct and
            predictable printing by print service providers. The
            standard has gone through multiple revisions over the
            years and has several published parts, the most recently
            released being part 8, specifying different levels of
            conformance: PDF/X-1a:2001, PDF/X-3:2002, PDF/X-1a:2003,
            PDF/X-3:2003, PDF/X-4, PDF/X-4p, PDF/X-5, PDF/X-5g,
            PDF/X-5pg and PDF/X-5n.
          </t>
          <t>
            PDF/A, initially released in 2005, specifies how to use
            PDF for long-term preservation (archiving) of electronic
            documents. It prohibits PDF features which are not well
            suited to long term archiving of documents. Its
            requirements for PDF/A viewers include color management
            guidelines and support for embedded fonts. There are three
            parts of this standard and a total of eight conformance levels:
            PDF/A-1a, PDF/A-1b, PDF/A-2a,
            PDF/A-2b, PDF/A-2u, PDF/A-3a, PDF/A-3b and PDF/A-3u.
          </t>
          <t>
            PDF/E, initially released in 2008 as PDF/E-1 <xref
            target='ISOPDFE'/>, specifies how to use PDF in
            engineering workflows, such as manufacturing, construction
            and geospatial analysis. Future revisions of PDF/E are
            supposed to include support for 3D PDF workflows.
          </t>
          <t>
            PDF/VT, initially released in 2010, specifies how to use
            PDF in variable and transactional printing. It is based on
            PDF/X, and adds adidtional restrictions on PDF content
            elements and supporting metadata. It specifies three
            conformance levels: PDF/VT-1, PDF/VT-2 and PDF/VT-2s <xref
            target='ISOPDFVT'/>.
          </t>
          <t>
            PDF/UA, initially released in 2012 as PDF/UA-1 <xref
            target='ISOPDFUA'/>, specifies how to create accessible
            electonic documents. It requires use of ISO 32000's Tagged
            PDF feature, and adds many requirements regarding semantic
            correctness in applying logical structures to content in
            PDF documents.
          </t>
        </list>
      </t>
      <t>
        All of these subset standards use <spanx
        style="verb">application/pdf</spanx> media type.  The subset
        standards are generally not exclusive, so it is possible to
        construct a PDF file which conforms to, for example, both
        PDF/A-2b and PDF/X-4 subset standards.
      </t>
      <t>
        PDF documents claiming conformance to one or more of the
        subset standards use XMP metadata to identify levels of
        conformance. PDF processors should examine document metadata
        streams for such subset standards identifiers and, if
        apropriate, label documents as such when presenting them to
        the user.
      </t>
    </section>
    
    <section anchor='compat' title='PDF Implementations'>
      <t>
          PDF format has gone through several revisions, primarily for the addition of features.
          PDF features have generally been added in a way that older viewers 'fail gracefully'
          because they can just ignore features they do not recognize, but even so, the older the
          PDF version produced, the more legacy viewers will support that version, but the fewer
          features will be enabled.
      </t>
      <t>
        PDF files are experienced through a reader or viewer of PDF files.
          For most of the common platforms in use (iOS, OS X, Windows, Android, ChromeOS, Kindle)
          and for most browsers (Edge, Safari, Chrome,	Firefox), PDF viewing is built-in. In addition,
          there are	many PDF viewers available for download and install. The PDF specification
          was published and freely available since the format was introduced in 1993, so hundreds
          of companies and organizations make tools for PDF creation, viewing, and manipulation.
      </t>
    </section>
    <section anchor='security' title='Security Considerations'>
      <t>
        The PDF file format allows several constructs which may
        compromise security if handled inadequately by PDF
        processors. For example:

          <list style="symbols">
              <t>
                PDF may contain scripts to customize the displaying
                and processing of PDF files. These scripts are
                expressed in a version of JavaScript and are intended
                for execution by the PDF processor.
              </t>
              <t>
                PDF file may refer to other PDF files for portions of
                content.  PDF processors are expected to find these
                external files and load them in order to display the
                document.

              </t>
              <t>
                  PDF may act as a container for various files embedded in it (for example,
                  as attached files). PDF processors may offer functionality to open and
                  display such files or store them on the system.
              </t>
              <t>
                  PDF files may contain links to content on the internet. PDF processors
                  may offer functionality to show such content upon following the link.
              </t>
          </list>
      </t>
      <t>
        In addition, the PDF processor itself, as well as its plugins, scripts etc. may be a
          source of insecurity, by either obvious or subtle means.
      </t>
    </section>
    
    <section title='IANA Considerations'>
      <t>
	This document updates the registration
	of <spanx style="verb">application/pdf</spanx>, a media type
	registration as defined in <xref target='RFC6838'/>:
      </t>
      <t>
	Type name: application
      </t>
      <t>
	Subtype name: pdf
      </t>
      <t>
	Required parameters: none
      </t>
      <t>
	Optional parameter: none
      </t>
      <t>
	Encoding considerations: binary
      </t>
      <t>
	Security considerations: See <xref target='security'/>
	of this document.
      </t>
      <t>
	Interoperability considerations: See <xref
	target='compat'/> of this document.
      </t>
      <t>
	Published specification: ISO 32000-1:2008 (PDF 1.7)
	<xref target='ISOPDF'/>. ISO 32000-2 (PDF 2.0) <xref target='ISOPDF2'/> is currently under development.
      </t>
      <t>
	Applications which use this media type: See <xref
	target='compat'/> of this document.
      </t>
      <t>
	Fragment identifier considerations: See <xref
	target='fragments'/> of this document.
      </t>
      <t>
	Additional information:
      </t>
      <t>
	Deprecated alias names for this type: none
      </t>
      <t>
	Magic number(s): All PDF files start with the characters
	'%PDF-' followed by the PDF version number, e.g., "%PDF-1.7".
	These characters are in US-ASCII encoding.
      </t>
      <t>
	File extension(s): .pdf
      </t>
      <t>
	Macintosh file type code(s): "PDF "
      </t>
      <t>
	Person &amp; email address to contact for further information:
	Duff Johnson &lt;duff@duff-johnson.com&gt;, Peter Wyatt
	&lt;Peter.wyatt@cisra.canon.com.au&gt;, ISO 32000 Project Leaders
      </t>
      <t>
	Intended usage: COMMON
      </t>
      <t>
	Restrictions on usage: none
      </t>
      <t>Author: Authors of this document</t>
      <t>
        Change controller: ISO; in particular, ISO 32000 is by
	ISO/TC 171/SC 02/WG 08, "PDF specification".  Duff Johnson
        &lt;duff@duff-johnson.com&gt; and Peter Wyatt
        &lt;Peter.wyatt@cisra.canon.com.au are current ISO 32000
        Project Leaders.
      </t>
      
    </section>
  </middle>
  <back>
    <references title="Normative References">
      
      <!-- ?rfc include='reference.ISO.32000-1.2008' ? -->
      <reference anchor="ISOPDF">
	<front>
	  <title>Document management -- Portable document format -- Part 1: PDF 1.7</title>
	  <author>
	    <organization>ISO</organization>
	  </author>
	  <date month="" year="2008"/>
	</front>
	<seriesInfo name="ISO" value="32000-1:2008"/>
	<annotation>Also available free from Adobe Systems.</annotation>
      </reference>

      <!-- ?rfc include='reference.ISO.32000-2' ? -->
      <reference anchor="ISOPDF2">
	<front>
	  <title>Document management -- Portable document format -- Part 2: PDF 2.0</title>
	  <author>
	    <organization>ISO</organization>
	  </author>
	  <date month="" year=""/>
	</front>
	<seriesInfo name="ISO" value="32000-2"/>
	<annotation>Currently under development - publication expected in 2017. This becomes a Normative Reference on approval.</annotation>
      </reference>
      
    </references>

    <references title="Informative References">
      <reference anchor="ISOPDFX">
          <front>
              <title>Graphic technology -- Prepress digital data exchange using PDF --
                  Part 8: Partial exchange of printing data using PDF 1.6 (PDF/X-5)
              </title>
              <author>
                  <organization>ISO</organization>
              </author>
              <date month="" year="2008"/>
          </front>
          <seriesInfo name="ISO" value="15930-8:2008"/>
      </reference>
      <reference anchor="ISOPDFA">
          <front>
              <title>Document management -- Electronic document file format for long-term preservation
                  -- Part 3: Use of ISO 32000-1 with support for embedded files (PDF/A-3)
              </title>
              <author>
                  <organization>ISO</organization>
              </author>
              <date month="" year="2012"/>
          </front>
          <seriesInfo name="ISO" value="19005-3:2012"/>
      </reference>
      <reference anchor="ISOPDFE">
          <front>
              <title>Document management -- Engineering document format using PDF -- Part 1:
                  Use of PDF 1.6 (PDF/E-1)
              </title>
              <author>
                  <organization>ISO</organization>
              </author>
              <date month="" year="2008"/>
          </front>
          <seriesInfo name="ISO" value="24517-1:2008"/>
      </reference>
      <reference anchor="ISOPDFVT">
          <front>
              <title>Graphic technology -- Variable data exchange -- Part 2:
                  Using PDF/X-4 and PDF/X-5 (PDF/VT-1 and PDF/VT-2)
              </title>
              <author>
                  <organization>ISO</organization>
              </author>
              <date month="" year="2010"/>
          </front>
          <seriesInfo name="ISO" value="16612-2:2010"/>
      </reference>
      <reference anchor="ISOPDFUA">
          <front>
              <title>Document management applications -- Electronic document file format enhancement
                    for accessibility -- Part 1: Use of ISO 32000-1 (PDF/UA-1)
              </title>
              <author>
                  <organization>ISO</organization>
              </author>
              <date month="" year="2014"/>
          </front>
          <seriesInfo name="ISO" value="14289-1:2014"/>
      </reference>
      
      <!-- rfc include='reference.ISO.16684-1.2012' XMP -->
      <reference anchor="XMP">
	<front>
	  <title>Extensible metadata platform (XMP) specification -- Part 1: Data model, serialization and core properties</title>
	  <author>
	    <organization>ISO</organization>
	  </author>
	  <date month="" year="2012"/>
	</front>
	<seriesInfo name="ISO" value="16684-1"/>
	<annotation>Not available for free, but there are a
	number of descriptive resources, e.g., 
	<eref target="http://en.wikipedia.org/wiki/Extensible_Metadata_Platform"/>
	</annotation>	
      </reference>

      <!-- rfc include='reference.Adobe.postscript'
	   PostScript -->
      <reference anchor="PS">
	<front>
	  <title>PostScript Language Reference, third edition</title>
	  <author>
	    <organization>Adobe Systems Incorporated</organization>
	  </author>
	  <date month="" year="1999"/>
	</front>
      </reference>
      
      <?rfc include='reference.RFC.6838' ?>
      <?rfc include='reference.RFC.3986' ?>
    </references>
    <section title='Changes since RFC 3778'>
      <t>
	This specification replaces RFC 3778, which previously
	defined the <spanx style="verb">application/pdf</spanx>
	Media Type. Differences include:
	<list style="symbols">
	  <t>
	    To reflect the transition from a proprietary specification
	    by Adobe to an open ISO Standard, the Change Controller
	    has changed from Adobe to ISO, and references updated.
	  </t>
	  <t>
	    The overview of PDF capabilitiies, the history of PDF, and
	    the descriptions of PDF subsets were updated to reflect
	    more recent relevant history.
	  </t>
	  <t>
	    The section on Fragment identifiers was updated to closely
	    reflect the material which has been added to ISO-32000-2.
	  </t>
	  <t>
	    The status of popular PDF implementations was
	    updated.
	  </t>
	  <t>
	    The Security Considerations were updated to match current
	    status.
	  </t>
	  <t>
	    The registration template was updated to match RFC 6838.
	  </t>
	</list>
      </t>
      </section>
  </back>
</rfc>
