此为 Mathematica 8 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)

PDF (.pdf)

MIME type: application/pdf
Adobe Acrobat format.
Standard format for exchanging and archiving multi-page documents.
PDF is an acronym for Portable Document Format.
Binary file format.
Stores text, fonts, images, and 2D vector graphics in a device- and resolution-independent way.
Can also store embedded raster images.
Supports multiple lossy and lossless compression methods.
  • Import imports a PDF file, returning all pages as a list of graphics.
  • Export exports any expression to PDF.
  • Import["file.pdf"] converts the pages of a PDF file to Mathematica vector graphics.
  • Import["file.pdf", "Plaintext"] gives a plain text version of a PDF file.
  • Export["file.pdf", expr] creates a PDF file from an arbitrary expression, cell or notebook object.
  • Mathematica does not rasterize fonts or 2D vector graphics when exporting to PDF.
  • Import imports the specified element from a PDF file.
  • Import imports multiple elements.
  • Export creates a PDF file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • In the notebook front end, Insert ► Picture and the Open menu allow import of a PDF file into a cell.
  • Save As exports the active notebook as a PDF file.
  • Save Selection As exports the selected part of a notebook to PDF.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Pages"list of vector graphics, each representing a page of the PDF file
"Plaintext"textual content of the document, given as a string
"Attachments"list of attachments, imported as a Mathematica expression if possible
"RawAttachments"attachments given as a list of raw strings
  • Import by default uses the element.
  • On Export, attachments are given as a list of file path specifications or rules of the form "filename"-> expr, where is the name of the file attached to the PDF document, and expr is an arbitrary Mathematica expression. Objects that can be attached to PDF include Mathematica notebooks, cell expressions, text, image and graphics objects.
  • Importing individual pages:
"Pages",nvector graphics, representing the n^(th) page
"Plaintext",ntextual content of the n^(th) page
  • Meta-information elements:
"Author"name of person who created this document
"CreationDate"creation date of the document, given as a DateList specification
"Creator"program that created this file
"PageCount"number of pages
"Title"document title
"Password"Nonedocument password given as a string
"TextOutlines"Truewhether to import characters as outlines
ImageSizeAutomaticoverall image size
ImageResolution72image resolution for rasterization in dpi
"AllowRasterization"Automaticwhether to rasterize a graphic that requires advanced versions of PDF
  • Possible settings for :
Automaticautomatically choose the most suitable rendering method
Truerasterize a graphic that requires advanced versions of PDF
Falseuse vector graphics
This imports a simple PDF example file as graphics:
Show the Import elements available in this file:
Extract raw text from a PDF file:
Import three meta-information elements:
Export an image to PDF:
Export a typeset mathematical formula to a resolution-independent PDF:
Create a PDF file with a JPEG attachment:
Attach a file on your computer system to a PDF:
Import the resulting PDF:
Attach this notebook to a PDF:
This imports a simple PDF example file as graphics:
In[1]:=
Click for copyable input
Out[1]=
Show the Import elements available in this file:
In[2]:=
Click for copyable input
Out[2]=
Extract raw text from a PDF file:
In[3]:=
Click for copyable input
Out[3]=
Import three meta-information elements:
In[4]:=
Click for copyable input
Out[4]=
 
Export an image to PDF:
In[1]:=
Click for copyable input
Out[1]=
 
Export a typeset mathematical formula to a resolution-independent PDF:
In[1]:=
Click for copyable input
Out[1]//TraditionalForm=
In[2]:=
Click for copyable input
Out[2]=
 
Create a PDF file with a JPEG attachment:
In[1]:=
Click for copyable input
 
Attach a file on your computer system to a PDF:
In[1]:=
Click for copyable input
Out[1]=
Import the resulting PDF:
In[2]:=
Click for copyable input
Out[2]=
 
Attach this notebook to a PDF:
In[1]:=
Click for copyable input
Out[1]=