[rfc] present -o=slides.pdf

589 views
Skip to first unread message

Sebastien Binet

unread,
Feb 20, 2015, 6:25:19 PM2/20/15
to golang-nuts
hi there,

when you present slides in conferences -as Dave Cheney put it- you are
in unknown territory (or behind ennemy lines?) and many things can go
wrong.
in my line of work, it is usually required to upload the slides in
advance and while it's generally accepted to put a link to
talks.godoc.org, you might be presenting on a browser with... err...
limited capacities or compliance with standards.

long story short, a PDF is a nice backup solution to have at the ready.

IIRC, present doesn't have the ability to create a PDF and the
recommandation is to just use the print functionality of your favorite
$BROWSER. except, I have seen some rendering bugs[1].

so: would it be ok/desirable to add an optional PDF output for present?
or: would it be better to have an external tool producing this PDF
output (preferably leveraging most of the parsing logic of present,
exposed as a nice package) ?

-s

[1]: https://indico.cern.ch/event/342672/contribution/3/material/0/0.pdf
which has been created with chromium from this present slide deck:
http://talks.godoc.org/github.com/go-hep/talks/2014/20141022-binet-go-fwk-conc/go-fwk.slide#1
notice slide 2 and the 'go refresher' title slide split over a PDF page...

Dmitri Shuralyov

unread,
Feb 20, 2015, 11:22:29 PM2/20/15
to golan...@googlegroups.com
I have also seen rendering issues as well, and the process of converting .slide to .pdf was not as seamless as https://groups.google.com/forum/#!msg/golang-nuts/_4QhvyuKU4o/5SaWM18yaSkJ would lead one to believe.

The issues I've encountered were: mismatch of slide to pdf page size, mismatch of number of slides to number of pdf pages, and missing images when they happen to extend past slide borders (it worked fine in present mode though).

ajstarks

unread,
Feb 21, 2015, 12:31:31 PM2/21/15
to golan...@googlegroups.com
I agree that making a PDF is very convenient when presenting at random locations. In a pinch you can present from your phone, a random PC, etc.

I use pdfdeck [1], a client of the deck[2] package. Here are some examples: [3, 4, 5]
It would be nice (perhaps using the template package and deck/generate[6]) to create a translator from present markup to deck XML:

present2deck foo.slide | pdfdeck -pagesize 1024,768 -stdout /dev/stdin > foo.pdf

Egon

unread,
Feb 21, 2015, 1:22:06 PM2/21/15
to golan...@googlegroups.com
On Saturday, 21 February 2015 06:22:29 UTC+2, Dmitri Shuralyov wrote:
I have also seen rendering issues as well, and the process of converting .slide to .pdf was not as seamless as https://groups.google.com/forum/#!msg/golang-nuts/_4QhvyuKU4o/5SaWM18yaSkJ would lead one to believe.

It was that seamless at some point, I'm not certain when that behavior was broken again. I guess it shouldn't be that difficult to get it working again.

Sebastien Binet

unread,
Feb 21, 2015, 4:54:17 PM2/21/15
to ajstarks, golang-nuts
On Sat, Feb 21, 2015 at 6:31 PM, ajstarks <ajst...@gmail.com> wrote:
> I agree that making a PDF is very convenient when presenting at random
> locations. In a pinch you can present from your phone, a random PC, etc.
>
> I use pdfdeck [1], a client of the deck[2] package. Here are some examples:
> [3, 4, 5]
> It would be nice (perhaps using the template package and deck/generate[6])
> to create a translator from present markup to deck XML:
>
> present2deck foo.slide | pdfdeck -pagesize 1024,768 -stdout /dev/stdin >
> foo.pdf

yes. unfortunately, tools/present does a bit of html-ization while
parsing so one can not ATM just apply a custom text/template.Template
on present.Doc data (also because most of present.Doc and
present.Section methods expect html/template.Template)

so some amount of modification/clean-up of tools/present would be
needed. (or just fork it.)

I started my own little go program to translate to LaTeX/Beamer, but
perhaps deck-XML is a better intermediate representation...

-s

Egon

unread,
Feb 22, 2015, 5:02:53 AM2/22/15
to golan...@googlegroups.com, ajst...@gmail.com
I've made a fix at https://go-review.googlesource.com/5526

+ Egon

Dave Cheney

unread,
Feb 23, 2015, 5:05:23 AM2/23/15
to golan...@googlegroups.com
Thanks Egon. Surely pdf generation is just a specialised form of printing?
Reply all
Reply to author
Forward
0 new messages