Reproduced to: http://blog.csdn.net/iamduoluo/article/details/6820329
Swftools provides a series of tools to convert various files into SWF:
Font2swf.exe
Gif2swf.exe
Ipv2swf.exe
Ipv2swf.exe
Png2swf.exe
Wav2swf.exe
The specific functions are just as the name suggests.
The tool used to convert a PDF file into a SWF file is ipv2swf. Generally, running ipv2swf src.pdf des.swf in the command line can meet the requirements. The command line parameters can be obtained through ipv2swf-F:
-H,-help print short help message and exit print help information
-V,-version print version info and exit print version number
-O,-output file.swf direct output to file.swf. If file.swf contains '000000' (file13568630.swf), then each page specifies the output SWF file name
-P,-pages range convert only pages in range with range e.g. 1-20
Or 1, 4, 6, 9-11 or
Specifies the page range for conversion. The page number description method is the same as that used when the printer prints a file.
-P,-Password Use password for deciphering the pdf. Specify the password for opening the PDF.
-V,-verbose be verbose. use more than one-V for greater effect. Detailed content is output during conversion.
-Z,-zlib use flash 6 (MX) zlib compression. Use zlib compression mechanism of Flash 6
-I,-ignore allows into 2swf to change the draw order of the PDF. This may make the generated allow the program to modify the drawing sequence of the PDF, which may cause the results to be different from the original
-J,-maximum quality set quality of embedded JPEG pictures to quality. 0 is worst (small) and 100 is best (BIG ). (default: 85) set the quality of the JPEG image to be converted from 0 to 100. The default value is 85.
-S,-set Param = value set a SwF encoder specific parameter. See parameter 2swf-s help for more information. You can use the parameter 2swf-s help to obtain the parameters for SwF transcoding.
-W,-samewindow when converting PDF hyperlinks, don't make the links open a new window. Set the converted SWF to use the same window when opening the connection in the original PDF.
-T,-Stop insert a stop () command in each page. Add a stop () command at the end of each page.
-T,-flashversion num set flash version in the SWF header to num. Set the Flash version used by SWF
-F,-fontdir directory add directory to the font search path. specifies the path of the font file
-B,-defaultviewer link a standard viewer to the SWF file. Specify the default SWF navigation file to flip pages, zoom in and out
-L,-defaultloader link a standard preloader to the SWF file which will be displayed while the main SWF is loading. Specify the default SWF file to display the loading process effect.
-B,-Viewer filename link viewer filename to the SWF file. Specify the SWF navigation file, which works the same as-B.
-L,-preloader filename link preloader filename to the SWF file. Specify the SWF file to be loaded.
-Q,-Quiet suppress normal messages. Use-QQ to suppress warnings, also. Do not print common information, do not print warning information with-QQ.
-S,-shapes don't use SWF fonts, but store everything as shape. No font is used, and all are converted into shapes.
-F,-fonts store full fonts in SWF. (Don't reduce to used characters). Save All fonts in SWF.
-G,-flatten remove as your clip layers from file as possible. Remove the film layers in the file as much as possible and merge them.
-I,-Info don't do actual conversion, just display a list Of all pages in the PDF. No actual conversion is performed, only PDF information is displayed.
-Q,-maxtime n abort conversion after n seconds. Only available on Unix. Exit if the running time times out.
--------------------------------------------------------------------------------
Then let's see what-S can set:
PDF parameters:
PDF device global parameters:
Fontdir = a directory with additional fonts specifies the font Directory, which is similar to-F of level 1 parameters.
Font = an additional Font filename add additional font files
Pages = the range of pages to convert (example: pages = 1-100,210-) specifies the page range, which is similar to-P of level 1 parameters.
Zoom = the resolution (default: 72) specifies the resolution. The default value is 72 dpi.
Export agedir = add an xpdf language directory, useful for non-Western European characters
Multiply = render everything at the resolution rendering at several times of resolution
Poly2bitmap convert graphics to bitmaps converts a graph into a dot matrix.
Bitmap convert everything to bitmaps converts all content into a dot matrix (including a font)
SWF parameters:
SWF layer options:
Required subpixels = <pixels> resolution adjustment for JPEG images (same as jpegdpi, but in pixels) JPEG image resolution
Ppmsubpixels = <pixels> resolution adjustment for Lossless images (same asppmdpi, but in pixels) lossless image resolution
Subpixels = <pixels> shortcut for setting both limit subpixels and ppmsubpixels
Drawonlyshapes convert everything to shapes (currently broken)
Ignoredraworder allow to perform a few optimizations for creating smaller SWFs allows small Optimizations
Linksopennewwindow make links open a new browser window link opens a new window
Linktarget target window name of new links new link window name
Linkcolor = <color) color of links (Format: rrggbbaa) link color
Linknameurl link buttons will be named like the URL they refer to (handy for iterating through links with ActionScript) The Link name is consistent with the link URL
Storeallcharacters don't reduce the fonts to used characters in the output file to save all Character Fonts
Enablezlib switch on zlib compression (also done if flashversion> = 7) Use zlib for compression
Bboxvars store the bounding box of the SWF file in ActionScript variables saves the SWF area size in
Dots take care to handle dots correctly save single-point display
Reordertags = 0/1 (default: 1) perform some tag optimizations perform some tag Optimization
Internallinkfunction = <Name> when the user clicks a internal link (to a different page) in the converted file, this ActionScript function is a called internal link function. If you click an internal link, the ActionScript function will be called.
Externallinkfunction = <Name> when the user clicks an external link (e.g. http://www.foo.bar/) on the converted file, this ActionScript function is the called external link function, if you click an external link, it is called
Disable_polygon_conversion never convert strokes to polygons (will remove capstyles and joint styles) do not convert strokes into Polygon
Caplinewidth = <width> the minimum thichness a line needs to have so that capstyles become visible (and are converted) The minimum conversion width of a line is not converted.
Insertstop put an ActionScript "stop" tag in every frame Add the stop () function to each worker of SwF
Protect Add a "protect" tag to the file, to prevent loadingin The Flash editor Add the protect tag, prohibit loading the SWF in Flash
Flashversion = <version> the SWF fileversion (6) sets the lowest SWF version
Framerate = <FPS> SWF framerate
Minlinewidth = <width> convert horizontal/vertical boxes smaller than thiswidth to lines (0.05) convert a rectangle with a width less than a certain value into a line
Simpleviewer add next/previous buttons to the SWF use simple navigation
Animate insert a showframe tag after each placeobject (animate draw order of PDF files )???
Required quality = <quality> set compression quality of JPEG images sets the JPEG compression quality
Splinequality = <value> set the quality of spline convertion to value (0-100, default: 100). Set the conversion quality of the spline.
Disablelinks disable links. Disable link
--------------------------------------------------------------------------------
In the Chinese PDF conversion will encounter some trouble, the specific solution :( http://blog.csdn.net/jiang1984j/archive/2010/07/23/5757427.aspx)
1. Download swftools: http://www.swftools.org/download.html
Download xpdf-Chinese-Simplified
Download two Chinese font files
2. Install swftools to any path
Decompress xpdf to any path
Decompress the Chinese font to the xdpf \ Chinese-Simplified \ cmap folder.
3. Modify the xpdfrc file in xpdf to change the cidtounicode and other paths to the local path,
Modify the Chinese-Simplified \ add-to-xpdfrc file in xpdf.
4. Open the command line window: Export 2swf-O output file path-T input file path-s export agedir = xpdf path \ Chinese-Simplified
--------------------------------------------------------------------------------
Some PDF images have poor conversion performance and lead to excessive shapes. In this case, you can use the-s poly2bitmap parameter to convert the image into a dot matrix. The size of the generated SWF is smaller.
Add the "-T 9" parameter and set the output version to flash9. This solves the problem that only one page of the PDF file is available and the generated SWF cannot be played.