Swftools convert PDF to SWF FAQ

Source: Internet
Author: User

Swftools convert PDF to SWF
Swftools provides a series of tools to turn various files into SWF:

Font2swf.exe
Gif2swf.exe
Jpeg2swf.exe
Pdf2swf.exe
Png2swf.exe
Wav2swf.exe
The specific function as the name implies.

The tool that turns PDF into SWF is pdf2swf. Running pdf2swf src.pdf des.swf in the command line generally satisfies the requirements. Command-line arguments can be obtained by pdf2swf-f:

-H, Help print short help message and exit printing assistance information
-V, –version print version info and exit prints the build number
-O, –output file.swf Direct output to file.swf. If file.swf contains ' 13568621′ (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 of the transformation, using the same page number description method as when the printer prints the file

-p, –password password use password for deciphering the PDF. Specify the password to open the PDF
-V, –verbose be verbose. Use the than one-v for greater effect. Output detailed content when converting
-Z, –zlib use Flash 6 (MX) zlib compression. zlib compression mechanism using Flash 6
-I, –ignore allows pdf2swf to change the draw order of the PDF. The generated allows the program to modify the drawing order of the PDF, which may result in a difference from the original
-j, –jpegquality quality Set quality of embedded JPEG pictures to quality. 0 is worst (small), the best (big). (default:85) Sets the quality of the JPEG image to convert from 0 to 100, the default value is 85.
-S, –set Param=value set a SWF encoder specific parameter.  See Pdf2swf-s to more information. Set the parameters of the SWF transcoding, the specific parameters can be obtained with pdf2swf-s help
-W, –samewindow when converting PDF hyperlinks, don ' t make the links open a new window. Set the converted SWF to open the connection in the original PDF using the same window
-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 number used by the SWF
-F, –fontdir directory Add directory to the font search path. Specify the path to the font file
-B, –defaultviewer Link a standard viewer to the SWF file. Specify the default SWF navigation file to page, zoom in, and more
-L, –defaultloader Link a preloader to the SWF file which'll be displayed while the main SWF is load     Ing. Specifies the default SWF load file to display the load process effect
-B, –viewer filename Link viewer filename to the SWF file. Specify SWF navigation file, effect same-B
-L, –preloader filename Link preloader filename to the SWF file. Specifies that the SWF loads the file, acting as-l
-Q, –quiet suppress normal messages.  USE-QQ to suppress warnings, also. No general information is printed and the warning message is not printed with-QQ.
-S, –shapes Don ' t use SWF Fonts, but store everything as shape. No fonts are used, and all are converted to shapes.
-F, –fonts Store full fonts in SWF. (Don ' t reduce to used characters). Saves all fonts in the SWF.
-G, –flatten Remove as many clip layers from file as possible. Try to remove the film layers in the file and merge them
-I, –info Don ' t do actual conversion, just display a list of all pages in the PDF. Does not do the actual conversion, only displays the information of the PDF.
-Q, –maxtime n Abort conversion after n seconds. Only available on Unix. Exits if the runtime times out.

--------------------------------------------------------------------------------
Then look at what the-s can set:
PDF Parameters:
PDF Device Global Parameters:
Fontdir= a directory with additional fonts specified font directory, similar to-F for Level 1 parameters
font= an additional font filename to 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 for level 1 parameters
Zoom= the resolution (DEFAULT:72) specifies the resolution, which defaults to 72dpi
languagedir= Add an Xpdf language directory adds a Xpdf language directory that is useful for non-Western European characters
Multiply= render everything at the resolution is rendered at several times resolution
Poly2bitmap convert graphics to bitmaps turn the graphic into dot matrix
Bitmap convert everything to bitmaps turn everything into dots (including fonts)

SWF Parameters:

SWF Layer Options:
Jpegsubpixels=<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 Jpegsubpixels and Ppmsubpixels quick setup on two parameters
Drawonlyshapes convert everything to shapes (currently broken) all turned into graphics
Ignoredraworder allow to perform a few optimizations for creating smaller SWFs allows performing some small optimizations
Linksopennewwindow make links open a new browser window link
LinkTarget target window Name of new links window
Linkcolor=<color) Color of links (Format:rrggbbaa)
Linknameurl Link buttons'll be named like the URL they refer to (handy for iterating through links with ACTIONSC Ript) Link name is consistent with link URL
Storeallcharacters don ' t reduce the fonts to used characters in the output file save all character fonts
Enablezlib switch on zlib compression (also done if flashversion>=7) using zlib compression
Bboxvars Store the bounding box of the SWF file in ActionScript variables save the area size of the SWF in as
Dots to handle dots correctly save single point display
REORDERTAGS=0/1 (default:1) perform some tag optimizations performs some tag optimizations
internallinkfunction=<name> when the user clicks a internal link (to a different page) in the converted file, this a Ctionscript function is called internal link functions, if you click on an internal link, the ActionScript function will be called
externallinkfunction=<name> when the user clicks a external link (e.g. http://www.foo.bar/) on the converted file, This ActionScript functions is called external link function, if you click an external link, the ActionScript function will be called
Disable_polygon_conversion never convert strokes to polygons (will remove capstyles and joint styles) do not turn strokes into polygons
Caplinewidth=<width> the minimum thichness a line needs to having so that capstyles become visible (and is con verted) line minimum conversion width, which will not be converted than this thin line
Insertstop put an ActionScript ' stop ' tag in every frame add stop () function to each of the SWF frames
Protect add a "protect" tag to the file, to prevent loadingin the Flash Editor add protect tag, disable loading in Flash The SWF
Flashversion=<version> the SWF fileversion (6) Set the minimum SWF version
Framerate=<fps> SWF framerate Set frame rate
minlinewidth=<width> convert horizontal/vertical boxes smaller than thiswidth to lines (0.05) turn a rectangle with a width less than a value into a line
Simpleviewer Add next/previous buttons to the SWF using simple navigation
Animate insert a showframe tag after each placeobject (animate draw order of PDF files)???
Jpegquality=<quality> set compression quality of JPEG images sets the compression quality of JPEG
Splinequality=<value> Set The quality of spline convertion to value (0-100, default:100). Set the conversion quality of a spline
Disablelinks Disable links. Forbidden Links


--------------------------------------------------------------------------------
In the Chinese-language PDF conversion will encounter some trouble, the specific solution: (Javaeye on the text)
1. Download swftools:http://www.swftools.org/download.html

Download Xpdf xpdf-chinese-simplified

Download two Chinese font file font files

2. Install Swftools to any path

Unzip xpdf to any path

Unzip the Chinese font to the Xdpf\chinese-simplified\cmap folder

3. Modify the Xpdf XPDFRC file to change the Cidtounicode path to the native path.

Modify Xpdf under CHINESE-SIMPLIFIED\ADD-TO-XPDFRC file ibid.

4. Open command Line window: Pdf2swf-o output file path-T input file path-s languagedir=xpdf path \chinese-simplified


--------------------------------------------------------------------------------
Some of the graphics in the PDF conversion effect is not good, will produce too much shape, in this case you can use the-s poly2bitmap parameters, the graph into a lattice. The resulting SWF size is small.


Tags:font, PDF, SWF

This entry were posted on Wednesday, February 18th, 11:19 a.m. and is filed under Flash, Font. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Responses to "Swftools convert PDF to swf"
Lji Says:

March 26th, at 4:21 pm
Praise the good text! Thank you so much! I have a problem with your method of handling a Chinese document:
Couldn ' t find a font for ' blackbody '
The font encoding for this document is "Gbk-euc-h", the actual font is blackbody, and the type is TrueType (CID).
Ask, reply!

Polo Says:

March 26th, at 5:38 pm
1. From copying a simhei.ttf to Xdpf\chinese-simplified\cmap,
2. Modify Xpdf XPDFRC file, add a line: DISPLAYCIDFONTTT adobe-gb1 Simhei.ttf Path

If you have any questions, please send the PDF file to [email protected]

Flyday Says:

May 20th, at 1:53 pm
Recently in the study of Swftools
Just to see your article is really thank you very much ~
But I have a question.
Can I use Swftools to detect the total number of pages in a PDF?

Polo Says:

May 20th, at 4:14 pm
It seems that I can not, because the need to get the number of pages, I used Swftools also encountered, and looked at the public parameters and the source code to identify the parameters, there is no special page to get the function.

You can use a soil method: Specify the number of pages by the-p parameter to see the return information, to detect the existence of the page.
Of course, you can use Pdflib to convert to TXT, and then count the number of page breaks in it.

Apple Says:

August 6th, at 4:40 pm
Why do I use this tool to go to PDF, those mathematical formula a lot of garbled ah, good depressed ah, there is no way to solve it? Thx

Test Says:

September 23rd, at 5:00 pm
It is good to convert it into a picture directly if it is garbled.

Grassking Says:

December 8th, at 11:56 a.m.
String command = "C:\\Program Files\\swftools\\pdf2swf.exe" + "-T" + sourcepath + "\ \" + "-s languagedir=d:\\xpdf\\ Xpdf-chinese-simplified "+"-s flashversion=9 "+"-o "+ DestPath + fileName;

Process Pro = Runtime.getruntime (). exec (command);
An error occurred while converting through Java statements, is it wrong to use the command?

Polo Says:

December 9th, at 7:23 pm
Back to Grassking:

Your command string should be preceded by a space between the different substrings.
It would be a wrong order to be connected.

Grassking Says:

December 10th, at 11:36 a.m.
Well, thank you for your guidance. I define the StringBuffer type and then add the combination through append to pass the test.
Just the font path seems to be a bit of a problem, first engage, do not ask you again. Thank you.

Grassking Says:

December 10th, at 6:10 pm
When I do a font test, it appears at the command prompt
ERROR Could not open D:\XPDF\CHINESE-SIMPLIFIED\ADD-TO-XPDFRC
Ask ADD-TO-XPDFRC to save why type Ah, and XPDFRC This file has two types, one is. bat, one is untyped, and the path to the two files in the path is changed? Thank you!

Polo Says:

December 16th, at 11:41 a.m.
ADD-TO-XPDFRC should have no suffix.

Wing Says:

January 14th at 10:16 pm
Hello, I use Swftools version of snapshot, the result directly on the error exit
With the current release version
Result hint cannot find bold font
I will follow the instructions as follows:

DISPLAYCIDFONTTT ADOBE-GB1 Simhei.ttf's Path

There's still no improvement in the results.
Still can't see the words
It seems that the document is full of bold .....

I have sent you an email to receive your reply

Wing Says:

January 14th at 10:19 pm
The hint is like this.

Error:couldn ' t find a font for ' blackbody, Bold '
Error:couldn ' t find a font for ' blackbody '
Error:couldn ' t find a font for ' blackbody '
Error:couldn ' t find a font for ' Simhei '
Error:couldn ' t find a font for ' blackbody '

Wing Says:

January 14th at 10:28 pm
Hello thank you for your article at present my side can use the normal
But I will

DISPLAYCIDFONTTT ADOBE-GB1 Simhei.ttf's Path

Add to XPDFRC no effect
Add to ADD-TO-XPDFRC only effect

。。。。。 I don't know why I want you to answer it.

Swftools convert PDF to SWF FAQ

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.