Ditto, I also really enjoyed Thursday's session and learned a lot - thanks to 
David and everyone else. I also found it interesting as an opportunity to air 
out some broader issues, such as the choice of migration path (e.g. supporting 
both python 2 & 3, versus migrating to support 3 only etc), and the use (or 
non-use) of external dependencies.

Best wishes, Peter

--

P.J.Briggs@[email protected]

 

--- On Sat, 19/3/11, [email protected] <[email protected]> wrote:

From: [email protected] <[email protected]>
Subject: Re: [python-north-west] Notes, slide, etc.
To: [email protected]
Date: Saturday, 19 March, 2011, 7:58

On 18 March 2011 09:18, David Jones <[email protected]> wrote:


Notes and slides (and a script to convert SVG files to PNG) for my

short presentation last night are here:



http://code.google.com/p/ccc-gistemp/source/browse/#svn%2Ftrunk%2Fdoc%2F2011-03-15%2Fpython3


I really enjoyed the session on Thursday.  It's was real eye-opener.  Many 
thanks for the slides and for volunteering to (a) lay bare your code and (b) 
grin and bear porting it in front of a barking audience!  For those that 
couldn't attend, I'll post some brief meeting notes in due course.






I added this link to our Wiki (which I almost forgot we had):

http://pynw.org.uk/Talks
It hasn't forgotten you ;)






Now, how do I convert 5 InkScape SVG files into one PDF?  Or is there

some other way I should bundle my presentation?

Interesting question.  Anand in last month's meeting showed us how he uses 
wkhtmltopdf (http://code.google.com/p/wkhtmltopdf/) to convert svg to pdf.  
Using this followed by pdftk would do the trick.  The following just about gets 
you there in bash, the only issue being centralisation of text in the PDF so 
options to wkhtmltopdf might need tweaking:


for i in slide*.svg; do wkhtmltopdf -O landscape $i ${i%svg}pdf; done; pdftk 
slide*.pdf cat output presentation.pdf


For something more Pythonic to convert SVG to PDF, I've always kept the 
following under my pillow which uses Cairo and rsvg.  Disclaimer: I've not used 
it for a while and haven't got round to installing rsvg yet on my newish laptop:


import sysimport os

import cairoimport rsvg


def size_points(svg):    props = svg.props

    return props.width / props.dpi_x * 72, props.height / props.dpi_y * 72


infile = sys.argv[1]outfile = sys.argv[2] if len(sys.argv) > 2 else 
os.path.splitext(infile)[0] + '.pdf'


svg = rsvg.Handle(file=infile)with open(outfile, 'wb') as fout:

    surface = cairo.PDFSurface(fout, *size_points(svg))    ctx = 
cairo.Context(surface)

    svg.render_cairo(ctx)    surface.finish()


Cheers,
Safe





Cheers,

 drj



--

To post: [email protected]

To unsubscribe: [email protected]

Feeds: http://groups.google.com/group/python-north-west/feeds

More options: http://groups.google.com/group/python-north-west






-- 

To post: [email protected]

To unsubscribe: [email protected]

Feeds: http://groups.google.com/group/python-north-west/feeds

More options: http://groups.google.com/group/python-north-west

-- 
To post: [email protected]
To unsubscribe: [email protected]
Feeds: http://groups.google.com/group/python-north-west/feeds
More options: http://groups.google.com/group/python-north-west

Reply via email to