Hi, What about PdfPainter::SetClipRect ?
Otherwise it is possible to add custom drawing commands using PdfPage::GetContents()->GetStream()->BeginAppend( .. ), PdfPage::GetContents()->GetStream()->Append( .. ) and PdfPage::GetContents()->GetStream()->EndAppend(). best regards, Dom Am Wednesday 24 October 2007 schrieb Jonathan Sibony: > What I really need is the equivalent code in pdf for the following > postscript code (example): > > newpath > 10 10 moveto > 10 50 lineto > 50 50 lineto > 50 10 lineto > Closepath > Clip > > I called 'clip' directly without save-restore, this will clip all further > content to this rect. Result will be a blank page (in original page size) > with a rect somewhere where we can see the content. > > CropBox apparently will set the page size to the cropped rect which is not > what I need (my bad). > > Furthermore, I do not need that only a part of the stream will be written > to file, it may be as well fully written but with the addition of the above > directive that indicates what part to render. > > Is there a way to flush my code some how to podofo file? (some kind of > WriteString())? > > Thanks > jonathan > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Pierre > Marchand Sent: Tuesday, October 23, 2007 8:16 PM > To: podofo-users@lists.sourceforge.net > Subject: Re: [Podofo-users] Setting a Crop Box > > Le Tuesday 23 October 2007 17:30:14 Jonathan Sibony, vous avez écrit : > > Hello, > > > > How do I set a Crop Box? (any painting will take place from that point > > only within the new clipping path). > > I see the PdfPage has a GetCropBox(), but how do I set one myself? > > > > Thanks in advance > > jonathan > > extracted from podofoimpose.cpp > ================================================== > PdfObject trimbox; > PdfRect trim(extraSpace, extraSpace, destWidth, destHeight); > trim.ToVariant(trimbox); > PdfPage * newpage = targetDoc->CreatePage ( PdfRect ( 0.0, 0.0, pw, ph ) ); > newpage->GetObject()->GetDictionary().AddKey( PdfName("TrimBox"), trimbox); > ================================================== > Would be the same for any box. -- ********************************************************************** Dominik Seichter - [EMAIL PROTECTED] KRename - http://www.krename.net - Powerful batch renamer for KDE KBarcode - http://www.kbarcode.net - Barcode and label printing PoDoFo - http://podofo.sf.net - PDF generation and parsing library SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game, for KDE Alan - http://alan.sf.net - A Turing Machine in Java **********************************************************************
pgpQgKVyMtPff.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users