2 # -*- coding: UTF-8 -*-
5 # graphical user interface for pdf2swf
7 # Part of the swftools package.
9 # Copyright (c) 2008,2009 Matthias Kramm <kramm@quiss.org>
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
25 from gui.fields import Choose
30 desc = (u'The SWF will be in "raw" format, with each page a seperate frame. '
31 u"Use this if you want to add a viewer yourself afterwards.")
34 Choose("flashversion", u"Flash version:",
35 (u"4", 4, u"5", 5, u"6", 6, u"7", 7, u"8", 8, u"9", 9), 2),
36 Choose("insertstop", u"Insert stop after each frame:",
37 (u"no", 0, u"yes", 1), 0),
38 Choose("transparent", u"Make SWF file transparent:",
39 (u"no", 0, u"yes", 1), 0),
44 from gui.plugin import Plugin
46 def __init__(self, swf, filename):
47 for opt in swf_options:
48 swf.setparameter(opt.name, str(opt.value))
50 def init(swf, filename):
51 return Raw(swf, filename)
53 from wx.lib.embeddedimage import PyEmbeddedImage
54 preview = PyEmbeddedImage(
55 "iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAIAAAC2vXM1AAAAAXNSR0IArs4c6QAADGNJREFU"
56 "eNrtXX1MFEcU36/74LwDvByNnIqaFL9ORU2MEUNtE6AVIxWjFuN30ESNTWtiIhpBTVDSNk2j"
57 "Jq3RfvxhNPEPg2kaVFo1ChgNKQo5vURRMIBIICdwX9zt7Gz/eHZc9/aWQ45DcN8fl7nZudmZ"
58 "t++9+b33ZucoSqN3IPFtwhhjjKFAPiOR9GooFBJFsaCgYGyzi4t5j8FgcNOmTTt37kQIMQxD"
59 "URR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getpreviewImage = preview.GetImage
118 getpreviewBitmap = preview.GetBitmap
119 getpreviewIcon = preview.GetIcon