swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] pdf2swf and extra margins


From: Matthias Kramm
Subject: Re: [Swftools-common] pdf2swf and extra margins
Date: Fri, 23 Nov 2007 11:54:00 +0100
User-agent: Mutt/1.5.6i

On Thu, Nov 22, 2007 at 11:05:22PM +0100, Pablo Rodríguez wrote:
> The issue here is that one must know the page size in order to set the
> new width or height. This is a real problem when converting
> automatically different files with different page sizes.

In that case, try the following Python script:

-----------------------------------------------------------------------
#!/usr/bin/python
import gfx

add_to_x = 100
add_to_y = 100

doc = gfx.open("pdf", "file.pdf")
swf = gfx.SWF()
for pagenr in range(doc.pages):
    page = doc.getPage(pagenr+1)
    swf.startpage(page.width + add_to_x, page.height + add_to_y)
    page.render(swf)
    swf.endpage()

swf.save("file.swf")
-----------------------------------------------------------------------

You'll need to compile gfx.so / gfx.dll for this to work.

Greetings

Matthias






reply via email to

[Prev in Thread] Current Thread [Next in Thread]