In 2004 Thomas Merz answered to a similar question for embedding JPEG
images as button symbols using pdfmark instructions.
http://groups.google.com/group/comp.text.pdf/browse_thread/thread/56fa7b86e555b6cc
I successfully rebuilt the situation and added a rectangle to hide the
original image (because the button was meant to be non-printing).
I am still experimenting with using a direct EPS instead of the JPEG-
turned-into-EPS, but until now to no avail. I would be glad for any
hints.
- Michael
|
|
0
|
|
|
|
Reply
|
ISO
|
4/28/2010 6:50:01 PM |
|
On Apr 28, 9:50=A0pm, Michael M=FCller-Hillebrand <i...@cap-studio.de>
wrote:
> In 2004 Thomas Merz answered to a similar question for embedding JPEG
> images as button symbols using pdfmark instructions.
>
> http://groups.google.com/group/comp.text.pdf/browse_thread/thread/56f...
>
> I successfully rebuilt the situation and added a rectangle to hide the
> original image (because the button was meant to be non-printing).
>
> I am still experimenting with using a direct EPS instead of the JPEG-
> turned-into-EPS, but until now to no avail. I would be glad for any
> hints.
>
> - Michael
Simply wrap whatever marking operations you need (text, raster images,
including whatever results from placing en EPS) with /BP - /EP
pdfmarks. For details see the =91pdfmark Reference Manual=92 <http://
www.adobe.com/devnet/acrobat/pdfs/pdfmark_reference.pdf>. Note that if
all you want is to obtain a PDF Form XObject to use as an appearance,
then you don=92t need /SP pdfmarks; those are to display the PDF Form
XObject on the page, similar to an execform displaying a PostScript
form.
I find the post you link to in your message uses a convoluted method,
with unpleasant side-effects. It does create the needed PDF Form
XObject, but =91manually=92 using very low-level constructs. It also
creates a PDF Image XObject, which is an unnecessary step. The side
effect of the method for creating the PDF Image XObject is that the
image is rendered on the page, so it later needs to be erased.
It=92s much easier to just do:
[ /_objdef {myIcon} /BBox [...] /BP pdfmark
... image, including inline image data if necessary
... or the EPS obtained by converting the image
... or any other marking operations, including those coming
from EPS files
[ /EP pdfmark
As a bonus, the result of the marking operations between /BP and /EP
goes only into the PDF Form XObject, and don=92t dirty the page. So,
nothing to erase later...
|
|
0
|
|
|
|
Reply
|
SaGS
|
4/30/2010 10:36:13 AM
|
|
Thanks a lot for the tip. Now I know why I had a hard time
understanding some of that old code.
I ended up doing it this way with an EPS:
save
0.1 0.1 scale % make sure to stay inside current area
[ /_objdef {myIcon} /BBox [...] /BP pdfmark % take BBox data from
following EPS
/showpage {} def % otherwise a page may be created
% EPS data, unchanged
[ /EP pdfmark
restore % to balance the save
% followed by the button definition, including
/MK << % Appearance
/IF << /SW /A /S /P /FB true >>
/TP 1
/I {myIcon}
>>
Thanks again,
- Michael
On Apr 30, 12:36=A0pm, SaGS <sags5...@gmail.com> wrote:
> Simply wrap whatever marking operations you need (text, raster images,
> including whatever results from placing en EPS) with /BP - /EP
> pdfmarks. For details see the =91pdfmark Reference Manual=92 <http://www.=
adobe.com/devnet/acrobat/pdfs/pdfmark_reference.pdf>. Note that if
> all you want is to obtain a PDF Form XObject to use as an appearance,
> then you don=92t need /SP pdfmarks; those are to display the PDF Form
> XObject on the page, similar to an execform displaying a PostScript
> form.
>
> I find the post you link to in your message uses a convoluted method,
> with unpleasant side-effects. It does create the needed PDF Form
> XObject, but =91manually=92 using very low-level constructs. It also
> creates a PDF Image XObject, which is an unnecessary step. The side
> effect of the method for creating the PDF Image XObject is that the
> image is rendered on the page, so it later needs to be erased.
>
> It=92s much easier to just do:
>
> =A0 =A0 [ /_objdef {myIcon} /BBox [...] /BP pdfmark
> =A0 =A0 =A0 =A0 ... image, including inline image data if necessary
> =A0 =A0 =A0 =A0 ... or the EPS obtained by converting the image
> =A0 =A0 =A0 =A0 ... or any other marking operations, including those comi=
ng
> from EPS files
> =A0 =A0 [ /EP pdfmark
>
> As a bonus, the result of the marking operations between /BP and /EP
> goes only into the PDF Form XObject, and don=92t dirty the page. So,
> nothing to erase later...
|
|
0
|
|
|
|
Reply
|
ISO
|
5/1/2010 4:27:38 PM
|
|
|
2 Replies
313 Views
(page loaded in 0.041 seconds)
|