[Scribus] Script export to PDF in Scribus with Python?
Craig Ringer
craig
Tue Jun 15 03:56:51 CEST 2004
On Mon, 2004-06-14 at 15:12, VANEK Petr wrote:
> > Is it possible to script the export of scribus documents to
> > PDF via the Python
> > scripting interface? I noticed that "SavePageAsEPS(...)" is
> > there, but I
> > couldn't find any mention of anything like a "SaveAsPDF(...)"
> > function. Is
> > anything like this planned?
> not yet planned... just discussed days before. There is a lot of (I mean _A_LOT_OF)
> options for PDF exporting - compare the export eps and pdf procedures from
> Scribus itself.
> Do you think that the following example should be the solution?
>
> SaveAsPDF(filename, listOfFontsIncluded, compressGraphics, ... blah blah blah ..., lcmsProfile...)
>
> I hope there will be OOP avalable in Scribus python.
There are various library wrapper tools like SIP that might make that
possible. It's something I'd love to look into if I ever get the chance.
I think I may have mentioned SIP to you before on IRC, so sorry if I'm
repeating myself.
> My idea looks like:
>
> pdf = scribus.ExportPDF()
> pdf.filename = "file.pdf"
> pdf.sampleImageDPI = 300
> ... etc ...
> pdf.savePDF()
Would using keyword arguments with sensible defaults be an option? If a
general "target" option is provided, somewhat like the
-dPDFSETTINGS=/target arg to ps2pdf, then it could be quite manageable.
SaveAsPDF(filename, target=screen, compressGraphics=False)
I've been looking at trying to convert a couple of functions (especially
NewDoc) to use keyword arguments as it is, to make them a bit nicer to
use. If I get a chance to do that, I'll make sure to provide a patch for
people to try out.
I'd love to be able to do:
NewDoc()
and have the effect of:
NewDoc( Paper_A4, ...)
... preferably picking up the defaults from the New dialog box, but if I
can't figure that out then at least sane defaults.
SaveAsPDF seems another strong candidate for such treatment.
--
Craig Ringer
More information about the scribus
mailing list