[poppler] Patch for embedding videos in to the pdf
srinivas adicherla
srinivas.adicherla at gmail.com
Thu Feb 24 21:28:21 PST 2011
Hi Albert,
I think i got it what you are going to tell.
Is it like I need to put
#ifdef ENABLE_PNG
#include<png.h>
#endif
and along with this,
In my code wherever I use the functions that defined in png.h
library
I need to use the similar kind of condition to check right
like,
#ifdef ENABLE_PNG
my code
#endif
is this what you were telling?
On Fri, Feb 25, 2011 at 10:26 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 (srinivas adicherla)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 25 Feb 2011 10:26:02 +0530
> From: srinivas adicherla <srinivas.adicherla at gmail.com>
> Subject: Re: [poppler] Patch for embedding videos in to the pdf
> To: poppler at lists.freedesktop.org
> Message-ID:
> <AANLkTik4Lst6pnJy24Z3Dq8SnfvczR+ziH3cwCnRK=qc at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Albert,
>
> Yes, My code will not compile if png.h is not there.
>
>
> Thanks
> A Srinivas
>
> On Fri, Feb 25, 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. poppler/GfxFont.cc (Albert Astals Cid)
> > 2. Branch 'poppler-0.16' - poppler/GfxFont.cc (Albert Astals Cid)
> > 3. Re: Patch for embedding videos in to the pdf (Albert Astals Cid)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Thu, 24 Feb 2011 10:45:05 -0800 (PST)
> > From: aacid at kemper.freedesktop.org (Albert Astals Cid)
> > Subject: [poppler] poppler/GfxFont.cc
> > To: poppler at lists.freedesktop.org
> > Message-ID: <20110224184505.24C9410050 at kemper.freedesktop.org>
> >
> > poppler/GfxFont.cc | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > New commits:
> > commit 3590a2d38082fc705040cdb31bf0b22ff12dd3e4
> > Author: Adrian Johnson <ajohnson at redneon.com>
> > Date: Thu Feb 24 18:47:35 2011 +0000
> >
> > Fix rendering of some substituted fonts
> >
> > More info in bug 34522
> >
> > diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
> > index 0a165a6..d80208d 100644
> > --- a/poppler/GfxFont.cc
> > +++ b/poppler/GfxFont.cc
> > @@ -23,6 +23,7 @@
> > // Copyright (C) 2009 Peter Kerzum <kerzum at yandex-team.ru>
> > // Copyright (C) 2009, 2010 David Benjamin <davidben at mit.edu>
> > // Copyright (C) 2011 Axel Str?bing <axel.struebing at freenet.de>
> > +// Copyright (C) 2011 Adrian Johnson <ajohnson at redneon.com>
> > //
> > // To see a description of the changes please see the Changelog file
> that
> > // came with your tarball or type make ChangeLog if you are building
> from
> > git
> > @@ -1215,7 +1216,7 @@ Gushort *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType
> > *ff) {
> > cmap = 0;
> > useMacRoman = gFalse;
> > useUnicode = gFalse;
> > - if (hasEncoding) {
> > + if (hasEncoding || type == fontType1) {
> > if (usesMacRomanEnc && macRomanCmap >= 0) {
> > cmap = macRomanCmap;
> > useMacRoman = gTrue;
> >
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Thu, 24 Feb 2011 10:45:39 -0800 (PST)
> > From: aacid at kemper.freedesktop.org (Albert Astals Cid)
> > Subject: [poppler] Branch 'poppler-0.16' - poppler/GfxFont.cc
> > To: poppler at lists.freedesktop.org
> > Message-ID: <20110224184539.A17CE10050 at kemper.freedesktop.org>
> >
> > poppler/GfxFont.cc | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > New commits:
> > commit 4808b5c42f742363b51624aa4b6d02e6e6d3a30c
> > Author: Adrian Johnson <ajohnson at redneon.com>
> > Date: Thu Feb 24 18:47:35 2011 +0000
> >
> > Fix rendering of some substituted fonts
> >
> > More info in bug 34522
> >
> > diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
> > index 0a165a6..d80208d 100644
> > --- a/poppler/GfxFont.cc
> > +++ b/poppler/GfxFont.cc
> > @@ -23,6 +23,7 @@
> > // Copyright (C) 2009 Peter Kerzum <kerzum at yandex-team.ru>
> > // Copyright (C) 2009, 2010 David Benjamin <davidben at mit.edu>
> > // Copyright (C) 2011 Axel Str?bing <axel.struebing at freenet.de>
> > +// Copyright (C) 2011 Adrian Johnson <ajohnson at redneon.com>
> > //
> > // To see a description of the changes please see the Changelog file
> that
> > // came with your tarball or type make ChangeLog if you are building
> from
> > git
> > @@ -1215,7 +1216,7 @@ Gushort *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType
> > *ff) {
> > cmap = 0;
> > useMacRoman = gFalse;
> > useUnicode = gFalse;
> > - if (hasEncoding) {
> > + if (hasEncoding || type == fontType1) {
> > if (usesMacRomanEnc && macRomanCmap >= 0) {
> > cmap = macRomanCmap;
> > useMacRoman = gTrue;
> >
> >
> > ------------------------------
> >
> > Message: 3
> > Date: Thu, 24 Feb 2011 18:52:58 +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: <201102241852.58531.aacid at kde.org>
> > Content-Type: Text/Plain; charset="us-ascii"
> >
> > A Dijous, 24 de febrer de 2011, srinivas adicherla va escriure:
> > > Hi Albert
> > >
> > > Thank you for giving me tips.
> > > I included #if defined(ENABLE_PNG)
> > > #include "PNGWriter.h"
> > > #endif
> > >
> > > that is what in some places you were doing.
> >
> > Your code will not compile if png.h is not there, right?
> >
> > > About Object's freeing issue. It is not setting the value at all if
> we
> > > free it in the function.
> > > I saw in other places also if we initialize the objects then they are
> > not
> > > freeing, but if we get some value in to the objects
> > > usng dict.lookup("key", &obj); then they are freeing it. This is what I
> > > found.
> >
> > Sorry, my bad both dictSet and arrayAdd do shallow copies of the objects
> so
> > you don't need to free them.
> >
> > Albert
> >
> > >
> > >
> > > So please give me update on this.
> > >
> > > Thank you
> > > A Srinivas
> > >
> > > On Wed, Feb 23, 2011 at 5:46 PM, <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: Font substitution in Poppler (Albert Astals Cid)
> > > > 2. Re: Patch for embedding videos in to the pdf. (srinivas
> adicherla)
> > > >
> > > >
> ----------------------------------------------------------------------
> > > >
> > > > Message: 1
> > > > Date: Tue, 22 Feb 2011 20:23:44 +0000
> > > > From: Albert Astals Cid <aacid at kde.org>
> > > > Subject: Re: [poppler] Font substitution in Poppler
> > > > To: poppler at lists.freedesktop.org
> > > > Message-ID: <201102222023.44914.aacid at kde.org>
> > > > Content-Type: Text/Plain; charset="iso-8859-1"
> > > >
> > > > A Dimarts, 22 de febrer de 2011, jose.aliste at gmail.com va escriure:
> > > > > Hi,
> > > > >
> > > > > while reading GlobalParams.cc in poppler directory, I've noticed
> that
> > > > > when substituting, we only take into account substitutions for a
> > given
> > > > > font that are ttf or pfb. So I wondered why is this so? and, what
> > > > > would be the path to implement support for otf substitutions?
> > > >
> > > > Before worrying about the substitution have you checked if a pdf with
> a
> > > > otf font embedded renders correctly?
> > > >
> > > > Albert
> > > >
> > > > > Greetings
> > > > >
> > > > > Jos?
> > > > > _______________________________________________
> > > > > poppler mailing list
> > > > > poppler at lists.freedesktop.org
> > > > > http://lists.freedesktop.org/mailman/listinfo/poppler
> > > >
> > > > ------------------------------
> > > >
> > > > Message: 2
> > > > Date: Wed, 23 Feb 2011 17:46:52 +0530
> > > > From: srinivas adicherla <srinivas.adicherla at gmail.com>
> > > > Subject: Re: [poppler] Patch for embedding videos in to the pdf.
> > > > To: poppler at lists.freedesktop.org
> > > >
> > > > Message-ID:
> > > > <AANLkTimtinmd__D762OhdiJQ0JAnDDzTi-rxq4XtZykp at mail.gmail.com
> >
> > > >
> > > > Content-Type: text/plain; charset="iso-8859-1"
> > > >
> > > > Hi Albert
> > > >
> > > > 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.
> > > >
> > > > - 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.
> > > >
> > > > So is it fine?
> > > >
> > > > 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
> > > > > ***************************************
> > > >
> > > > -------------- next part --------------
> > > > An HTML attachment was scrubbed...
> > > > URL: <
> > > >
> >
> http://lists.freedesktop.org/archives/poppler/attachments/20110223/5ee0f3
> > > > 1c/attachment.html
> > > >
> > > > -------------- next part --------------
> > > > A non-text attachment was scrubbed...
> > > > Name: srinivas_video_embedd.patch
> > > > Type: text/x-patch
> > > > Size: 11746 bytes
> > > > Desc: not available
> > > > URL: <
> > > >
> >
> http://lists.freedesktop.org/archives/poppler/attachments/20110223/5ee0f3
> > > > 1c/attachment.bin
> > > >
> > > >
> > > > ------------------------------
> > > >
> > > > _______________________________________________
> > > > poppler mailing list
> > > > poppler at lists.freedesktop.org
> > > > http://lists.freedesktop.org/mailman/listinfo/poppler
> > > >
> > > >
> > > > End of poppler Digest, Vol 72, Issue 29
> > > > ***************************************
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
> >
> >
> > End of poppler Digest, Vol 72, Issue 32
> > ***************************************
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.freedesktop.org/archives/poppler/attachments/20110225/7d5c43b6/attachment.htm
> >
>
> ------------------------------
>
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
>
>
> End of poppler Digest, Vol 72, Issue 33
> ***************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20110225/2cafcf9e/attachment-0001.htm>
More information about the poppler
mailing list