[Paraview] Exporting to PDF from Python

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Sep 25 13:35:13 EDT 2014


With ParaView 4.2-RC, you can use the Python trace to generate the
script to use for exporting. It looks something like so:

ExportView('/tmp/sample.pdf', view=renderView1, Plottitle='MyPlot',
    Compressoutputfile=1,
    Linewidthscalingfactor=1.0,
    Pointsizescalingfactor=1.0)

For 4.1, look at the implementation of "ExportView" in [1]. You can
use a similar code for the same effect.

Utkarsh

[1] https://github.com/Kitware/ParaView/blob/master/Wrapping/Python/paraview/simple.py

On Wed, Sep 24, 2014 at 4:56 PM, D H <mrhyde at stanford.edu> wrote:
> Hi,
>
> I have a scene in Paraview 4.1 that I'd like to export to a PDF from a Python script.  Ideally I'd like to be able to use the GL2PSExporter and set options there (such as "Cull Hidden Primitives") like I do in the PV GUI (under File->Export Scene).  I've looked online and seen that I can export to a PDF via WriteImage("test.pdf",Writer="vtkPostScriptWriter"), but this doesn't offer me any of the flexibility I have when exporting from the GUI.
>
> Can someone recommend a way to export a PV view to PDF from Python that gives me the options of GL2PS?  Any suggestions are greatly appreciated - thanks very much!
>
> Best,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview


More information about the ParaView mailing list