ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* replacing images in PDF documents
@ 2015-02-15  0:27 Pablo Rodriguez
  2015-02-15 12:18 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Rodriguez @ 2015-02-15  0:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following situation, that I would like to solve using ConTeXt.

I have to generate a bunch of PDF documents daily, that someone else has
to validate (put a stamp on it [let’s put it that way]).

It might be a physical stamp, but it might be also a vector image.

One of the issues is that the stamp has a different place in each
document (almost).

Another issue is that the stamp should be added after the document is
generated, not before.

Having the following sample:

    \starttext
    I want this image replaced:
    \externalfigure[cow][scale=200]
    \stoptext

After generating the document (and not modifiying or recompiling the
source), is there a way to replace the image with another one?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: replacing images in PDF documents
  2015-02-15  0:27 replacing images in PDF documents Pablo Rodriguez
@ 2015-02-15 12:18 ` Hans Hagen
  2015-02-15 18:39   ` Pablo Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2015-02-15 12:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 2/15/2015 1:27 AM, Pablo Rodriguez wrote:
> Dear list,
>
> I have the following situation, that I would like to solve using ConTeXt.
>
> I have to generate a bunch of PDF documents daily, that someone else has
> to validate (put a stamp on it [let’s put it that way]).
>
> It might be a physical stamp, but it might be also a vector image.
>
> One of the issues is that the stamp has a different place in each
> document (almost).
>
> Another issue is that the stamp should be added after the document is
> generated, not before.
>
> Having the following sample:
>
>      \starttext
>      I want this image replaced:
>      \externalfigure[cow][scale=200]
>      \stoptext
>
> After generating the document (and not modifiying or recompiling the
> source), is there a way to replace the image with another one?

in principle you can append an image (xform) tit the pdf file, and then 
overload the old image object with the new content (using revision 
numbers of objects + extra xref table) but i never did that myself

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: replacing images in PDF documents
  2015-02-15 12:18 ` Hans Hagen
@ 2015-02-15 18:39   ` Pablo Rodriguez
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Rodriguez @ 2015-02-15 18:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 02/15/2015 01:18 PM, Hans Hagen wrote:
> On 2/15/2015 1:27 AM, Pablo Rodriguez wrote:
>> [...]
>> After generating the document (and not modifiying or recompiling the
>> source), is there a way to replace the image with another one?
> 
> in principle you can append an image (xform) tit the pdf file, and then 
> overload the old image object with the new content (using revision 
> numbers of objects + extra xref table) but i never did that myself

Many thanks for your reply, Hans.

Could this be implemented in ConTeXt?

I guess that the new document generation could be achieved with
something like:

    \setuppapersize[A4][A4]
    \setuplayout
      [backspace=0pt,
        topspace=0pt,
           width=middle,
          height=middle,
        location=middle,
          header=0pt,
          footer=0pt]
    \starttext
        \insertpages[document.pdf][width=0pt]
    \stoptext

The command could be something like:

    \replaceexternalfigure[oldimagefile][newimagefile]

BTW, I have just checked that file names include full paths (such as in
"/PTEX.FileName (/home/ousia/cow.pdf)". I guess that it would be safe
that searching and replacement mechanism could avoid full paths.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-15 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-15  0:27 replacing images in PDF documents Pablo Rodriguez
2015-02-15 12:18 ` Hans Hagen
2015-02-15 18:39   ` Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).