[vtkusers] Writing Postscript files from VTK

Goodwin Lawlor goodwin.lawlor at ucd.ie
Tue Oct 1 11:07:21 EDT 2002


Hi Carl,

If you dont have any luck with gl2ps I have a work around for writing PS
vector files from VTK under windows.

1. Use vtkCGMWriter to write a scene to file. This class is included in
vtk4.n but it is not built... so you have to add it yourself to the cmake
files and re-compile. Under windows and the borland compiler there were a
couple of small bugs. Email me if  they cause you any problems.

2. Download and install the universal postscript printer driver from adobe.

3. Insert the CGM file into a Word document. Make sure Word has the CGM
graphics importer installed

4. Print the Word page to a PS file using the PS printer driver.

5. You can fix the PS bounding box in GhostView

HTH

Goodwin
University College Dublin

----- Original Message -----
From: "Carl Hetherington" <lists at carlh.net>
To: "VTK Mailing list" <vtkusers at public.kitware.com>
Sent: Tuesday, October 01, 2002 1:32 PM
Subject: [vtkusers] Writing Postscript files from VTK


> Hi,
>
> I'm interested in writing vector Postscript files of VTK renderings.
> Consulting the mailing list archive suggests that gl2ps might be able to
> do this.  I've tried the following example:
>
> /* Set up a render window with a wireframe representation of a
> ** vtkPolyData.
> */
>
> /* ... */
>
>   FILE* fp = fopen("test.eps", "w");
>   int buffsize = 0;
>   int state = GL2PS_OVERFLOW;
>
>   while (state == GL2PS_OVERFLOW)
>   {
>     buffsize += 1024*1024;
>     gl2psBeginPage("Title", "Software", GL2PS_EPS, 0,
> GL2PS_SIMPLE_LINE_OFFSET, GL_RGBA, 0, NULL,
>    buffsize, fp, NULL);
>     window->Render();
>     state = gl2psEndPage();
>   }
>
>   fclose(fp);
>
> Unfortunately this gives me zero-sized EPS files, with gl2ps saying
> "GL2PS warning: Empty feedback buffer".
>
> Can anyone show me how it is done?
>
> Thanks in advance,
> Carl
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list