[Ipe-discuss] Script to export all views from all pages of the Ipe drawing

Nathaniel Cunningham nathaniel.cunningham at gmail.com
Mon Jun 4 12:57:41 CEST 2018


Wojtek,
Don't forget that Ipe stores its own extra data in PDF files, in order that
they can be opened again by Ipe. From the manual at
http://ipe.otfried.org/manual/manual_2.html:
"[PDF] files created by Ipe contain a special hidden stream that describes
the Ipe objects. (So if you edit your Ipe-generated PDF file in a different
program such as Adobe Acrobat, Ipe will not be able to read the file again
afterwards.)"

I don't know if that accounts for all the size difference you're seeing,
but you can test it by opening and saving the PDF with some other program.
If that takes care of the size difference, maybe you could add a step in
your script where some other program reads and saves the PDF?

-- Nathaniel


On Mon, Jun 4, 2018 at 12:41 PM, Wojciech Zabolotny via Ipe-discuss <
ipe-discuss at lists.science.uu.nl> wrote:

> I have noticed, that my script exports huge PDF files. I can get much
> smaller PDFs, when I use GUI and:
> 1. Set the desired View
> 2. Export it to EPS
> 3. Run "epstopdf" to convert EPS to PDF.
>
> Unfortunately, exportView does not support "eps" format. It is
> obvious, because the source code contains:
>
> bool Document::exportView(const char *fname, TFormat format, uint flags,
>                           int pno, int vno) const
> {
>   if (format != EPdf)
>     return false;
>
> GUI does something different:
>
> function MODEL:action_export_eps()
> [...]
>     self.ui:renderPage(self.doc, self.pno, self.vno,
>                        "eps", s, 1.0, false, false)
>
> Unfortunately, the ui and its renderPage method seems to be not
> available for ipelets...
> Is it possible to efficiently export views from ipelet?
>
> TIA & Regards,
> Wojtek
>
> 2018-05-13 22:42 GMT+02:00 Wojciech Zabolotny <wzab01 at gmail.com>:
> > The first version of my script does not properly export LaTeX objects.
> > It is necessary to add doc:runLatex right after loading of the IPE
> drawing:
> >
> > doc = ipe.Document(fname)
> > doc:runLatex()
> >
> > After that modification, LaTeX equations and texts are rendered
> correctly.
> > --
> > Regards,
> > Wojtek
>
>
>
> --
> Wojciech M. Zabołotny
> My GPG/PGP keys:
> standard: 8192R/FE58A848 (0720 9430 85DB 7CCD F4C5  5F1E 5107 91FB FE58
> A848)
> confidential: 16384R/C76D2FB0 (C4E7 9597 CF22 7B5D 28BF  4656 FED7
> A63F C76D 2FB0)
> _______________________________________________
> Ipe-discuss mailing list
> Ipe-discuss at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/ipe-discuss/attachments/20180604/c0706ee3/attachment.html>


More information about the Ipe-discuss mailing list