[poppler] Patch for embedding videos in to the pdf.

Albert Astals Cid aacid at kde.org
Wed Feb 23 11:40:36 PST 2011


A Dimecres, 23 de febrer de 2011, srinivas adicherla va escriure:
> Hi Albert

Hi

> 
>           Thank you for your suggestions. Sorry it was long gap since you
> gave those suggestions. I was so busy after that.
> 
> - about "#include <png.h>". I don't know how to check for those in
> configure/cmake files.
> If any one can give me any ideas how to do, it will be really helpful. I
> just check for #ENABLE_PNG and including it. I don't know whether it is
> right or not.

Look at what we do in other files we include png.h

> - Other things I used valgrind for memory leaks. Still in some places like
> "object.initDict(xref)" it is showing definitely leak some bytes.
>   How to overcome those things. Not only in my code still in poppler some
> places it is showing leaking memory for initDict(xref) or initArray(xref).
>   But we cannot free those objects explicitly in our code, if we do like
> that. If we delete like that that value for that dictionary key it is not
> setting.

Yes you have to free the Object instances, most Object types are refcounted, 
thus free doesn't really mean free. It is just "i'm not using it anymore if 
noone else happens do be using it, free it". So calling free should be find 
and not kill the setting from the dictionary.

Albert

> 
> Please kindly give suggestios.
> 
> Thank you all in advance.
> 
> --
> A Srinivas
> 
> On Wed, Feb 16, 2011 at 1:30 AM, <poppler-
request at lists.freedesktop.org>wrote:
> > Send poppler mailing list submissions to
> > 
> >        poppler at lists.freedesktop.org
> > 
> > To subscribe or unsubscribe via the World Wide Web, visit
> > 
> >        http://lists.freedesktop.org/mailman/listinfo/poppler
> > 
> > or, via email, send a message with subject or body 'help' to
> > 
> >        poppler-request at lists.freedesktop.org
> > 
> > You can reach the person managing the list at
> > 
> >        poppler-owner at lists.freedesktop.org
> > 
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of poppler digest..."
> > 
> > Today's Topics:
> >   1. Re: Patch for embedding videos in to the pdf. (Albert Astals Cid)
> >   2. Re: pdf import in Inkscap using poppler_glib and
> >   
> >      poppler_cairo (Albert Astals Cid)
> >   
> >   3. Re: Patch for embedding videos in to the pdf. (Albert Astals Cid)
> > 
> > ----------------------------------------------------------------------
> > 
> > Message: 1
> > Date: Tue, 15 Feb 2011 19:13:09 +0000
> > From: Albert Astals Cid <aacid at kde.org>
> > Subject: Re: [poppler] Patch for embedding videos in to the pdf.
> > To: poppler at lists.freedesktop.org
> > Message-ID: <201102151913.10014.aacid at kde.org>
> > Content-Type: Text/Plain;  charset="us-ascii"
> > 
> > A Dimarts, 15 de febrer de 2011, srinivas adicherla va escriure:
> > > Hi all,
> > 
> > Hi
> > 
> > >     I made a patch for embedding videos into the pdf file. I created a
> > > 
> > > Screen annotation, and add a Rendition action to it. For appearance I
> > 
> > took
> > 
> > > the image from the user (only accepting png), later I will do for
> > > others also. I tested opening the embedded pdf files using Adobe and
> > > Foxit
> > 
> > Reader
> > 
> > > it was successfully opened for me. I tried for swf and mpg files.
> > > I am asking the user to specify the image because there are lot of
> > > video formats, so its time consuming for creating an image from the
> > > video frame for all types. ( May be in the future i add that or
> > > anybody can help me
> > 
> > in
> > 
> > > that).
> > > 
> > > I added the same in bugzilla.
> > 
> > Bad idea, don't do this. Either do it here or in the bugzilla but not in
> > both.
> > In two places just makes more difficult to follow the dicussion.
> > 
> > Albert
> > 
> > > Please give me suggestions to make this successful.
> > > 
> > > Thanks in Advance.
> > > A Srinivas
> > 
> > ------------------------------
> > 
> > Message: 2
> > Date: Tue, 15 Feb 2011 19:23:42 +0000
> > From: Albert Astals Cid <aacid at kde.org>
> > Subject: Re: [poppler] pdf import in Inkscap using poppler_glib and
> > 
> >        poppler_cairo
> > 
> > To: poppler at lists.freedesktop.org
> > Message-ID: <201102151923.43633.aacid at kde.org>
> > Content-Type: Text/Plain;  charset="iso-8859-1"
> > 
> > A Dimarts, 15 de febrer de 2011, Pino Toscano va escriure:
> > > Hi,
> > > 
> > > Alle marted? 15 febbraio 2011, the Adib ha scritto:
> > > > currently Inkscape uses poppler internal API to read in pdf files.
> > > > Those API breaks/changes from time to time.
> > > > 
> > > > Now I try importing pdf via poppler cairo surface and those cairo
> > > > surface as svg backend. So far that works.
> > > > 
> > > > But I do not have any control over the process:
> > > > - I can not set bitmap dpi
> > > > - I can not specify if text stays text or convert to path
> > > > etc.
> > > > 
> > > > Do you have any sugestions?
> > > 
> > > What I proposed more than one year ago:
> > > http://sourceforge.net/mailarchive/message.php?msg_id=24162410
> > 
> > That'd work me too :D
> > 
> > Also if your custom inkscape converter does not depend in inkscape i see
> > no reason why we could not have it inside poppler too if you commit to
> > maintaining it here (this way you'd be much safer to API changes)
> > 
> > Albert
> > 
> > 
> > ------------------------------
> > 
> > Message: 3
> > Date: Tue, 15 Feb 2011 19:50:51 +0000
> > From: Albert Astals Cid <aacid at kde.org>
> > Subject: Re: [poppler] Patch for embedding videos in to the pdf.
> > To: poppler at lists.freedesktop.org
> > Message-ID: <201102151950.51464.aacid at kde.org>
> > Content-Type: Text/Plain;  charset="us-ascii"
> > 
> > A Dimarts, 15 de febrer de 2011, srinivas adicherla va escriure:
> > > Hi all,
> > > 
> > >     I made a patch for embedding videos into the pdf file. I created a
> > > 
> > > Screen annotation, and add a Rendition action to it. For appearance I
> > 
> > took
> > 
> > > the image from the user (only accepting png), later I will do for
> > > others also. I tested opening the embedded pdf files using Adobe and
> > > Foxit
> > 
> > Reader
> > 
> > > it was successfully opened for me. I tried for swf and mpg files.
> > > I am asking the user to specify the image because there are lot of
> > > video formats, so its time consuming for creating an image from the
> > > video frame for all types. ( May be in the future i add that or
> > > anybody can help me
> > 
> > in
> > 
> > > that).
> > > 
> > > I added the same in bugzilla.
> > > 
> > > Please give me suggestions to make this successful.
> > 
> > Some quick things:
> >  * You use png.h unconditionally that is not going to work, you need to
> >  use
> > 
> > the proper defines to see if configure/cmake found it.
> > 
> >  * FILE *f;; <- extra ;
> >  * png_structp read_png;; <- again
> >  * error(-1, "The file could not be recognized as a PNG file."); <-- You
> > 
> > don't
> > close f here
> > 
> >  * You don't delete imgbuf
> >  * Wihtout having any idea png_create_info_struct seems like you should
> > 
> > call
> > destroy afterwards in the structure it returns
> > 
> >  * After
> >  
> >   MemStream *imgStream = load_from_png (img_file, &imgXObj, xrefA);
> >   if (!imgStream)
> >   
> >     return gFalse;
> >   
> >   you need to free all the Obj you've allocated
> >  
> >  * I'm pretty sure
> >  
> >   annotObj.dictSet("T", obj.initString(new GooString(video_name)));
> >   annotObj.dictSet("Contents", obj.initString(new
> >   GooString(video_name))); annotObj.dictSet("F", obj.initInt(4));
> >   is leaking memory as Object is not supposed to be reused without
> >   freeing
> > 
> > it
> > first, please use valgrind to detect leaks in your code
> > 
> > Albert
> > 
> > > Thanks in Advance.
> > > A Srinivas
> > 
> > ------------------------------
> > 
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
> > 
> > 
> > End of poppler Digest, Vol 72, Issue 21
> > ***************************************


More information about the poppler mailing list