|
SOLUTIONS
|
MATHEMATICA IMPORT/EXPORT FORMAT
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.
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 and ExportImport and Export
- Import["file.pdf"] imports a PDF file, returning all pages as a list of graphics.
- Export["file.pdf", expr] 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["file.pdf", elem] imports the specified element from a PDF file.
- Import["file.pdf", {elem, suba, subb, ...}] imports a subelement.
- Import["file.pdf", {{elem1, elem2, ...}}] imports multiple elements.
- The import format can be specified with Import["file", "PDF"] or Import["file", {"PDF", elem, ...}].
- Export["file.pdf", expr, elem] creates a PDF file by treating expr as specifying element elem.
- Export["file.pdf", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each
as specifying the corresponding
. - Export["file.pdf", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
- Export["file.pdf", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
- See the reference pages for full general information on Import and Export.
- ImportString and ExportString support PDF.
ElementsElements
- General Import elements:
-
"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",n vector graphics, representing the n
page"Plaintext",n textual content of the n
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
OptionsOptions
- Import options:
-
"Password" None document password given as a string "TextOutlines" True whether to import characters as outlines - General Export options:
-
ImageSize Automatic overall image size ImageResolution 72 image resolution for rasterization in dpi - Advanced Export option:
-
"AllowRasterization" Automatic whether to rasterize a graphic that requires advanced versions of PDF - Possible settings for
: -
Automatic automatically choose the most suitable rendering method True rasterize a graphic that requires advanced versions of PDF False use vector graphics
ExamplesExamplesopen allclose all
Basic Examples (6)Basic Examples (6)
This imports a simple PDF example file as graphics:
| In[1]:= |
| Out[1]= | ![]() |
Show the Import elements available in this file:
| In[2]:= |
| Out[2]= |
Extract raw text from a PDF file:
| In[3]:= |
| Out[3]= |
Import three meta-information elements:
| In[4]:= |
| Out[4]= |
| In[1]:= |
| Out[1]= |
Export a typeset mathematical formula to a resolution-independent PDF:
| In[1]:= |
Out[1]//TraditionalForm= | |
| In[2]:= |
| Out[2]= |
Create a PDF file with a JPEG attachment:
| In[1]:= |
Attach a file on your computer system to a PDF:
| In[1]:= |
| Out[1]= |
| In[2]:= |
| Out[2]= | ![]() |
Attach this notebook to a PDF:
| In[1]:= |
| Out[1]= |
New in 6 | Last modified in 8
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »




