Hi, The stream length seems to be ok. The XRef table is valid, too. I verified it with a hexeditor.
So the actual size does not seem to be the problem. I got the PDF file you
sent me, sorry for not comming back to you earlier.
It does not make a difference if the length is written inside of the object or
beyond the object. This has to do because of internal logics of PoDoFo.
What I found strange about this PDF: Why did you embedd the ICC profile twice?
Isn't it the same for both images? Maybe this confuses Photoshop? Maybe only
one ICC profile per PDF is supported.
best regards,
Dom
Am Wednesday 10 October 2007 schrieb Jonathan Sibony:
> Is there any chance that when the image stream is big, there is some
> kind of access problem via the reference table to the icc object (byte
> count too big...or other?).
> I noticed it always written after the image stream.
>
> BTW have you got the PDF file I sent you?
>
>
> Thanks
> Jonathan
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 26, 2007 9:09 AM
> To: [email protected]; Jonathan Sibony
> Subject: Re: [Podofo-users] ICC Profile support
>
> Hi,
>
> Hmmm, I can't see why the size of the image should matter for the ICC
> profile.
> Maybe something simple like the larger image being CMYK and the smaller
> one
> being RGB?
> Can you create a fresh PDF with Photoshop and embedd the ICC there and
> compare
> the results to the PDF created by PoDoFo?
> (PoDoFoBrowser/podofouncompress are
> your friends for task like these).
>
> Otherwise: Could you upload the PDF (or another example) somewhere so
> that I
> can try the PDF myself? I guess it is to large to be sent by email.
>
> best regards,
>
> Dom
>
> Am Tuesday 25 September 2007 schrieb Jonathan Sibony:
> > Hmmm I guess it was too early to celebrate.
> >
> > It seems that for small files (1x1 inch 72 dpi)all goes well (when
> > opening the file in photoshop, a dialog pops asking whether to use the
> > attached profile).
> > As to larger files (10x10 inch with 720 dpi) a different dialog is
> > issued asking the image dimensions and the requested resolution
>
> (should
>
> > be dictated automatically from the pdf as in small files) and profile
>
> is
>
> > not mentioned, instead default profile is used), when given it goes
> > rasterizing.
> >
> > Any clue?
> >
> > joanthan
> >
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, September 16, 2007 7:17 PM
> > To: [email protected]; Jonathan Sibony
> > Subject: Re: [Podofo-users] ICC Profile support
> >
> > Great that it works now!
> >
> > Could you please send me your code for ICC support or provide a patch
> > for
> > PoDoFo so that other users can also profit from this addition?
> >
> > best regards,
> > Dom
> >
> > Am Sunday 16 September 2007 schrieb Jonathan Sibony:
> > > I changed it a bit and it works! (image was messed up for CMYK
> >
> > profiles
> >
> > > at first but it seems to work now)
> > >
> > >
> > >
> > > Thanks again for your kind support!
> > >
> > > Joanthan
> > >
> > >
> > >
> > > ________________________________
> > >
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of
> >
> > Dominik
> >
> > > Seichter
> > > Sent: Sunday, September 16, 2007 11:24 AM
> > > To: [email protected]
> > > Subject: Re: [Podofo-users] ICC Profile support
> > >
> > >
> > >
> > > Hi,
> > >
> > > The string you are passing to PdfVecObjects::CreateObject( ) is the
> >
> > name
> >
> > > used for the /Type value of the object which is not required here.
> > >
> > > I think you code should look more like this:
> > >
> > > void PdfImage::SetICCProfile (PdfVecObjects* parent, const PdfName&
> > >
> > > rAlternate, char* profileData, long profileSize, long
>
> lColorComponents
>
> > )
> >
> > > {
> > >
> > > PdfObject* iccObject = parent->CreateObject();
> > >
> > > iccObject->GetDictionary().AddKey( PdfName("Alternate"), rAlternate
>
> );
>
> > > // The number of color compontens is required. It must be 1,3 or 4
>
> and
>
> > > // match the color compontens inside the ICC data
> > >
> > > iccObject->GetDictionary().AddKey( PdfName("N"),
>
> lColorComponents
>
> > );
> >
> > > PdfStream* iccStream = iccObject->GetStream();
> > >
> > > iccStream->Set( profileData, profileSize);
> > >
> > > // Now add the colorspace to our image
> > >
> > > PdfArray array;
> > >
> > > array.push_back( PdfName("ICCBased") );
> > >
> > > array.push_back( iccObject->Reference() );
> > >
> > > this->GetObject().GetDictionary().AddKey( PdfName("ColorSpace"),
>
> array
>
> > > );
> > >
> > > }
> > >
> > > The code is totally untested and was just written down from my mind.
> > > Important is that you add the correct number of colorcomponents
>
> ("N")
>
> > to
> >
> > > the ICC object and of course you have to tell the PdfImage some how
> > > which colorspace should be used. Therefore you have to add the
> > > ColorSpace key to the image dictionary.
> > >
> > > To get the correct number of colorcomponents it might be neccesarry
>
> to
>
> > > actually parse the ICC data but I am not sure about this as I did
>
> not
>
> > > yet work with ICC data.
> > >
> > > best regards,
> > >
> > > Dom
> > >
> > > Am Sunday 16 September 2007 schrieb Jonathan Sibony:
> > > > Thanks for the explanation; I pretty much followed your suggestion
> > >
> > > (very
> > >
> > > > simple).
> > > >
> > > >
> > > >
> > > > SetICCProfile is something like this:
> > > >
> > > >
> > > >
> > > > void PdfImage::SetICCProfile (PdfVecObjects* parent, const
>
> PdfName&
>
> > > > alternate, char* profileData, long profileSize(
> > > >
> > > > {
> > > >
> > > > PdfObject* iccObject =
> > > >
> > > > parent->CreateObject((alternate.GetName()).c_str());
> > > >
> > > > PdfStream* iccStream = iccObject->GetStream();
> > > >
> > > > iccStream->Set( profileData, profileSize);
> > > >
> > > > {
> > > >
> > > >
> > > >
> > > > Where alternate being passed is "ICCBased":
> > > >
> > > > pImage.SetICCProfile(parent, PdfName("ICCBased"), profileData,
> > > >
> > > > profileSize);
> > > >
> > > >
> > > >
> > > > I see that the object is being added however it doesn't seem to
>
> take
>
> > > > effect (should a profile be attached to an image file, photoshop
>
> for
>
> > > > example would immediately ask whether to use the profile or
>
> discard
>
> > > it,
> > >
> > > > or even when just inquiring the profile it should return the
>
> profile
>
> > > > instead of the default)
> > > >
> > > >
> > > >
> > > > Any clue?
> > > >
> > > >
> > > >
> > > > Thanks
> > > >
> > > > jonathan
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > >
> > > > From: [EMAIL PROTECTED]
> > > >
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of
> >
> > Craig
> >
> > > > Ringer
> > > >
> > > > Sent: Wednesday, September 12, 2007 3:02 PM
> > > >
> > > > To: Jonathan Sibony
> > > >
> > > > Cc: [email protected]
> > > >
> > > > Subject: Re: [Podofo-users] ICC Profile support
> > > >
> > > >
> > > >
> > > > ...
> > > >
> > > > Each PDF document has a single PdfVecObjects instance. You'll need
> >
> > to
> >
> > > > take this as an argument to your `SetICCProfile(...)' or whatever
> > > >
> > > > method, since the PdfImage doesn't keep track of its owning
> >
> > document.
> >
> > > To
> > >
> > > > the caller, the interface would thus be something like:
> > > >
> > > >
> > > >
> > > > SetICCProfile(PdfVecObjects* parent,
> > > >
> > > > const PdfName& alternate,
> > > >
> > > > const char * psProfileBytes,
> > > >
> > > > long int psProfileLength);
> > > >
> > > >
> > > >
> > > > Much of this is probably less than ideal in terms of interface and
> > >
> > > API.
> > >
> > > > Just explaining it has helped me get some ideas about how it could
> > > >
> > > > perhaps be made easier to understand through documentation and a
>
> few
>
> > > > changes.
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Craig Ringer
--
**********************************************************************
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
**********************************************************************
pgp1K8l9C7YpE.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 [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
