<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial">Hi,</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial">I implemented a VTK viewer in objective-c and I try to save the image as a pdf file. It works well for any NSV</FONT><FONT class="Apple-style-span" face="Arial">iew but I can't figure out how to save a VTK view. </FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial">here is my code (again it works well for nsview but I get a "blank" pdf file for the VTK view)</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial">- (</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">IBAction</FONT></FONT><FONT class="Apple-style-span" face="Arial">)SavePDF:(</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">id</FONT></FONT><FONT class="Apple-style-span" face="Arial">)sender</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">{</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">NSSavePanel *panel=[NSSavePanel savePanel];</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">[panel setRequiredFileType:</FONT><FONT class="Apple-style-span" color="#891315"><FONT class="Apple-style-span" face="Arial">@"pdf"</FONT></FONT><FONT class="Apple-style-span" face="Arial">];</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">[panel beginSheetForDirectory:</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">nil</FONT></FONT><FONT class="Apple-style-span" face="Arial"> file: </FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">nil</FONT></FONT><FONT class="Apple-style-span" face="Arial"> modalForWindow:[NSApp mainWindow] modalDelegate:</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">self</FONT></FONT><FONT class="Apple-style-span" face="Arial"> didEndSelector: </FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">@selector</FONT></FONT><FONT class="Apple-style-span" face="Arial">(PDF:returnCode:contextInfo:) contextInfo:</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">nil</FONT></FONT><FONT class="Apple-style-span" face="Arial">];</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">}</FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial">-(</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">void</FONT></FONT><FONT class="Apple-style-span" face="Arial">)PDF:(NSSavePanel*)sheet returnCode:(</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">int</FONT></FONT><FONT class="Apple-style-span" face="Arial">)code contextInfo:(</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">void</FONT></FONT><FONT class="Apple-style-span" face="Arial">*)contextInfo</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">{</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">if</FONT></FONT><FONT class="Apple-style-span" face="Arial"> (code==NSOKButton)</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">{</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">NSData* data=[VTK_view dataWithPDFInsideRect:[VTK_view bounds]];</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">[data writeToFile:[sheet filename]atomically:</FONT><FONT class="Apple-style-span" color="#760F50"><FONT class="Apple-style-span" face="Arial">YES</FONT></FONT><FONT class="Apple-style-span" face="Arial">];</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">}</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><FONT class="Apple-style-span" face="Arial">}</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial">thanks a lot,</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Arial">Olivier</FONT></DIV></BODY></HTML>