Re: [Podofo-users] Conversion Cals to Pdf not working anymore sinceswitch from 0.5.0 to svn trunk!
A PDF parsing, modification and creation library.
Brought to you by:
domseichter
From: Dominik S. <dom...@we...> - 2008-06-25 08:34:23
|
Hello Sebastian, I am sorry, I did indeed mix up PdfPainter:DrawImage and PdfPainter::DrawXObject! You are absolutely right: for DrawXObject you have to pass PdfXObject::GetPageSize().GetWidth() and PdfXObject::GetPageSize().GetHeight() as parameters for dScaleX and dScaleY. You could also use PdfPainter::DrawImage to draw your XObject (as PdfImage is a PdfXObject) and this is the case where PoDoFo will pick these default values. Sorry, Dom Am Mittwoch, 25. Juni 2008 schrieb EXTERNAL Loch Sebastian (Firma Ferchau; BhP/TEF17): > Hello Dom, > > again, I tried first at all your solution p.DrawXObject( 0, 0, &xo ); > but I'm getting an empty page!! That's why I tried to set the matrix > of my own and I contacted the mailing list. > > If I look into the PdfPainter class for me p.DrawXObject( 0, 0, &xo ); > equals to p.DrawXObject( 0, 0, &xo, 1, 1 ); > Where PoDoFoPo will pick default values, i.e. the size of the Xobject?? > > Anyways for me right it's ok as I got a working solution. > > Regards > Sebastian > > > -----Ursprüngliche Nachricht----- > Von: dom...@we... [mailto:dom...@we...] > Gesendet: Mittwoch, 25. Juni 2008 09:11 > An: EXTERNAL Loch Sebastian (Firma Ferchau; BhP/TEF17) > Cc: pod...@li... > Betreff: Re: AW: AW: [Podofo-users] Conversion Cals to Pdf not working > anymore sinceswitch from 0.5.0 to svn trunk! > > Yes, that is exactly the same PoDoFo does if you leave the parameters for > dScaleX and dScaleY away. So p.DrawXObject( 0, 10, &xo, pdfWidth, > pdfHeight ); and p.DrawXObject( 0, 10, &xo ); are equal. > > But at least it is working now :-) Sorry for the misunderstandings. > > > Am Mittwoch, 25. Juni 2008 schrieb EXTERNAL Loch Sebastian (Firma Ferchau; > > BhP/TEF17): > > I found a solution. > > > > When I specify the width and the height when drawing the Xobject it > > works: p.DrawXObject( 0, 10, &xo, pdfWidth, pdfHeight ); > > > > Maybe there's something wrong with the automatic setting of the matrix > > with the size of the Xobject... > > > > Regards > > Sebastian > > -----Ursprüngliche Nachricht----- > > Von: dom...@we... [mailto:dom...@we...] > > Gesendet: Mittwoch, 25. Juni 2008 08:34 > > An: EXTERNAL Loch Sebastian (Firma Ferchau; BhP/TEF17) > > Cc: pod...@li... > > Betreff: Re: AW: [Podofo-users] Conversion Cals to Pdf not working > > anymore sinceswitch from 0.5.0 to svn trunk! > > > > Sorry, I think my answer was not clear. You do not have to set the > > matrix, PoDoFo will do it for you. > > > > Unfortunately the old code of yours was setting the matrix in a wrong > > way: p.DrawXObject( 0, vPos, &xo, 1, 1 ); > > > > The last two parameters are 1 which result in a matrix like this: > > 1.000 0 0 1.000 0.000 10.000 cm > > > > If you leave the last 2 parameters to PdfPainter::DrawXObject away, > > PoDoFo will pick default values, i.e. the size of the XObject. > > > > So you onle have to use the line: > > p.DrawXObject( 0, vPos, &xo ); > > > > regards, > > Dom > > > > Am Mittwoch, 25. Juni 2008 schrieb EXTERNAL Loch Sebastian (Firma > > Ferchau; > > > > BhP/TEF17): > > > At the moment, I don't see how to set the matrix. > > > Maybe it's still to early... > > > > > > Probably by adding a key Matrix to the dictionary? > > > How can I specify these six values to the corresponding key? > > > > > > Regards > > > Sebastian > > > > > > -----Ursprüngliche Nachricht----- > > > Von: pod...@li... > > > [mailto:pod...@li...] Im Auftrag von > > > Dominik Seichter Gesendet: Dienstag, 24. Juni 2008 13:43 > > > An: pod...@li... > > > Cc: EXTERNAL Loch Sebastian (Firma Ferchau; BhP/TEF17) > > > Betreff: Re: [Podofo-users] Conversion Cals to Pdf not working anymore > > > sinceswitch from 0.5.0 to svn trunk! > > > > > > Hello, > > > > > > Matrix in the 0.5.0 PDF: 3168.000 0 0 2448.000 0.000 10.000 cm > > > Matrix in the 0.6.0 PDF: 1.000 0 0 1.000 0.000 10.000 cm > > > BBox of XObject in both: [ 0.0 0.0 3168.000 2448.000] > > > > > > So just setting the correct matrix before drawing the XObject does the > > > trick. > > > > > > Instead of p.DrawXObject( 0, vPos, &xo, 1, 1 ); just do > > > p.DrawXObject( 0, vPos, &xo );. PoDoFo will pick the correct default > > > values for scaling the XObject. This change was necessary because we > > > inconsistencies between drawing XObjects and Images. Sorry for the > > > inconviniences the change caused for you. > > > > > > best regards, > > > Dom > > > > > > Am Dienstag, 24. Juni 2008 schrieb EXTERNAL Loch Sebastian (Firma > > > Ferchau; > > > > > > BhP/TEF17): > > > > Hello all, > > > > > > > > I switched our project from old release 0.5.0 to the > > > > actual version from trunk, but our main functionality > > > > didn't work since this switch. > > > > > > > > We need to convert documents in Cals format to pdf. > > > > With the new version a Pdf document is created, but you > > > > see only a blank page! > > > > I attached an example origin document plus the generated pdfs > > > > with the old 0.5.0 and new version from trunk. > > > > Maybe someone can see what's going wrong there... > > > > > > > > The conversion is done by the following: > > > > -reading header data from cals containing width,height,dpi,... > > > > -creating pdf page > > > > -creating Xobject with subtype Image and CCITTFAXDecode filter > > > > -> creating appropriate dictionary > > > > -> setting raw data > > > > -finally drawing XObject to page and writing pdf document > > > > > > > > For more details see see attached code.txt. > > > > > > > > At the moment I have no idea why this conversion is going wrong. > > > > It seems that the created pdf has the "correct" structure, > > > > but I don't know for sure! Maybe someone can have please a look > > > > at the created files. > > > > > > > > Any help is appreciated! > > > > > > > > Thanks. > > > > > > > > Regards > > > > Sebastian -- ********************************************************************** Dominik Seichter - dom...@we... 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 ********************************************************************** |