Re: [Podofo-users] Podofocolor error

2017-09-30 Thread Matthew Brincke
Hello Matt, hello all,

currently on encountering an unsupported color space, the information
about it is discarded, so no output file can be produced in that case.
I don't have time to rectify that currently, sorry.

Best regards, mabri

> Matt S Rinc  has written on 26. Juli 2017 at 02:43:
> 
>   Podofocolor (latest library compiled with no errors on Mac) gives me this 
> error when opening CMYK colorspaced PDF:
> 
> > podofocolor lua ../podofo-0.9.5/tools/podofocolor/example.lua 
> > ff_ff-gs-cmyk-icc.pdf ff_dummy.pdf
> > 
> > Processing page  1...
> >    -> Lua is parsing page:    1
> > Unsupported colorspace name: R11Unknown color space 255 type.
> > Error: An error 45 ocurred during processing the pdf file
> > 
> > PoDoFo encountered an error. Error: 45 ePdfError_CannotConvertColor
> >     Error Description: This color format cannot be converted.
> >     Callstack:
> >     #0 Error Source: 
> > /Users/mattsrinc/Documents/Projekti/Freelancer/MyProjects/Convert Image to 
> > CMYK/podofo-0.9.5/tools/podofocolor/colorchanger.cpp:310
> (it doesn't matter what parameters I call podofocolor with, e.g. grayscale 
> etc)
> 
>   and gives me this error when opening RGB colorspaced PDF:
> 
> > podofocolor lua ../podofo-0.9.5/tools/podofocolor/example.lua ff_ff.pdf 
> > ff_dummy.pdf
> > <>
> > Processing page  1...
> >    -> Lua is parsing page:    1
> > Unsupported colorspace name: PatternUnknown color space 255 type.
> > Error: An error 45 ocurred during processing the pdf file
> > 
> > PoDoFo encountered an error. Error: 45 ePdfError_CannotConvertColor
> >     Error Description: This color format cannot be converted.
> >     Callstack:
> >     #0 Error Source: 
> > /Users/mattsrinc/Documents/Projekti/Freelancer/MyProjects/Convert Image to 
> > CMYK/podofo-0.9.5/tools/podofocolor/colorchanger.cpp:310
> 
>   Any help would be really appreciated. I doubt a C(++) program will rescue 
> me e.g. open a PDF, change colors in it and save it.
> 
> -- 
> 
> Matt Sergej Rinc 
>  Elearning, Video Marketing, Webinars, Presentations & SEO Copywriting. 
>  Prekorje 49, Celje, 3211, SI,
>  [www.prezentacija.si](http://www.prezentacija.si)
>  Hire me on Freelancer (mattsrinc)

> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! 
> http://sdm.link/slashdot___
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Signing encrypted pdfs

2017-09-30 Thread Matthew Brincke
Hello all,

> "F. E."  has written on 1 August 2017 at 15:00:
> 
> Hello dear podofo users,
> 
> I want to sign an already encrypted pdf using podofo, but I don't get it
> to work:
... snip ...
> 3.) Ok, so I thought, maybe I've got to set the security options again
> after loading the pdf. Did that, but when performing the write operation
> for signing, I got a cryptic runtime error (read access violation):
> 
> The error is thrown in 'base\PdfParserObj.cpp', Line 346:
> PdfInputStream* pInput = m_pEncrypt->CreateEncryptionInputStream(  );
> 
> The error states: "this->m_pEncrypt-> was 0xFFDF"
> 
... snip ...
> And now I'm out of ideas. Does anyone have a hint for me?

That very much sounds like a bug that should be fixed. Even if something
nonsensical is tried, a specific PdfError exception should be thrown
with an explanatory string, don't you think? I currently don't have time
for the debugging, sorry.

> 
> Best regards,
> 
> F.E.

Best regards, mabri

> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] insert image behind a document

2017-09-30 Thread Matthew Brincke
Hello Etienne, hello Denis, hello all,
> Etienne Robin  has written on 28 September 
> 2017 at 12:21:
> 
>  Hello,
... snip ...
> To really paint the image below the page content, the only solution I see is
> to edit the page content stream and insert the image painting (Do operator)
> at the beginning (something rather tricky to do …)

wouldn't it work to first do GetFilteredCopy() on the page's content stream
(GetObject() on the page, then GetStream() on the returned object) into
a buffer1, Set() the stream to empty, paint the image on the page, then
GetFilteredCopy() content stream of that into (another) buffer2?
Finally on the content stream mentioned first: BeginAppend(); Append(buffer2,
buffer2_length); Append(buffer1, buffer1_length); EndAppend();

Maybe it will also work to append buffer1 without first making a buffer2,
however, the 3-param version of BeginAppend() then has to be used with the
last two parameters set to false (see the docs for the first param, please).

Then the image will be drawn first, and then the other page content on top
of it. I haven't tested the suggestions (I currently don't have PoDoFo
installed), though still hope this helps.

> 
> Etienne
> 

Best regards, mabri

> > On 27 Sep 2017, at 09:40, MINNE Denis  wrote:
> > 
> > Hello.
> > 
> > First, i want to thank you for this program.
> > I’m trying to use the source code to create a program to add an image on an 
> > existing PDF.
> > I have used your programs, but the image is placed on the front of the 
> > document and the information’s on the page are hidden by the image.
> > Is it possible to force the image to be placed behind all other data’s
> > 
> > PdfMemDocument doc2( "0100100.PDF" );
> > PdfImage image();
> > 
> > image.LoadFromFile("DUPLICATA5.tif");
> > 
> > PdfPage* pPage = doc.GetPage(0);
> > painter.SetPage(pPage);
> > painter.DrawImage( 0, 0, , 1, 1 );
> > painter.FinishPage();
> > 
> > doc.Write("test3.pdf");
> > 
> > Thank you!  
> > 
> > Denis Minne
> >

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users