swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] pdf2swf - one movieclip per image


From: Matthias Kramm
Subject: Re: [Swftools-common] pdf2swf - one movieclip per image
Date: Fri, 24 Oct 2008 08:51:48 +0200
User-agent: Mutt/1.5.6i

On Thu, Oct 23, 2008 at 10:22:33PM +0000, Bas Horsting <address@hidden> wrote:
> I'm having this particular need for pdf2swf to generate a movieclip
> inside the generated SWF for / around every image inserted, so I can
> later access / make invisible / replace these images by accessing the
> resulting SWF through ActionScript. Would it be very difficult to
> build this in? 

If you're somewhat fluent in C/C++, it's not very difficult.

> How would I proceed to implement this?

Try the following:

In line 2225 of lib/devices/swf.c, change the code

    msg("<trace> Placing image, shape ID %d, bitmap ID %d", myshapeid, bitid);
    i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2);
    CXFORM cxform2 = gfxcxform_to_cxform(cxform);
    
swf_ObjectPlace(i->tag,myshapeid,getNewDepth(dev),&i->page_matrix,&cxform2,NULL);
to
    msg("<trace> Placing image, shape ID %d, bitmap ID %d", myshapeid, bitid); 
    int mcid = getNewID(dev);
    i->tag = swf_InsertTag(i->tag, ST_DEFINESPRITE);
    swf_SetU16(i->tag, mcid);
    i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2);
    CXFORM cxform2 = gfxcxform_to_cxform(cxform);
    swf_ObjectPlace(i->tag,myshapeid,1,&i->page_matrix,&cxform2,NULL);
    i->tag = swf_InsertTag(i->tag, ST_END);
    i->tag = swf_InsertTag(i->tag, ST_PLACEOBJECT2);
    swf_ObjectPlace(i->tag,mcid,getNewDepth(dev),0,0,0);

Greetings

Matthias






reply via email to

[Prev in Thread] Current Thread [Next in Thread]