RTF: same \pict in multiple locations?

M

Marcus

First, I apologize if this question is in the wrong group, I had trouble
finding somewhere suitable.

Now, my problem: I am encoding a rather large documents as an RTF files, to
allow users to open them in Word and edit them. Each section has a new
header with a logo in it. The logo is the same in every header, but the text
changes. The logo is a \pict in the RTF file. Putting this \pict in each
header makes the file very big, yet this is what Word seems to do when you
save as RTF. Is there no way to just put the \pict in one place and refer to
it from multiple other places?

Thanks a lot for any tips!!

Marcus
 
M

macropod

Hi Marcus,

If you bookmark the first instance of each picture, you can use cross
references (i.e. REF fields) to replicate it wherever else you want.

Cheers
 
M

Marcus

Thank you for the reply!

The bookmark thing sounds promising, but I haven't been able to get this to
work yet. The only thing I could find that links to a bookmark was the
\linkval control word of userprops. Do you happen to know how to do this
more specifically?

For example, I put a bookmark around the picture data like this:

{\*\shppict{\pict{\*\picprop\shplid1029{\sp{\sn shapeType}{\sv 75}}{\sp{\sn
fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn pibFlags}{\sv 2}}{\sp{\sn
fLine}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv
1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw4
498\pich1588\picwgoal2550\pichgoal900\jpegblip\bliptag460612881{\*\blipuid
1b746511fca5c85a20a7c02ab8087455}{\bkmkstart
headerpict}..................picture data here.............{\bkmkend}}}}

And then I tried to use that data in the next picture:

{\*\shppict{\pict{\*\picprop\shplid1029{\sp{\sn shapeType}{\sv 75}}{\sp{\sn
fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn pibFlags}{\sv 2}}{\sp{\sn
fLine}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv
1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw4
498\pich1588\picwgoal2550\pichgoal900\jpegblip\bliptag460612881{\*\blipuid
1b746511fca5c85a20a7c02ab8087455}{\\userprops{\\propname
headerpict}{\\proptype30}{\\linkval headerpict}}}}}

It doesn't work, which isn't very surprising since I don't know what
userprops are actually for and how to use them. Also, the only prop types
available are integer, real, date, bool, and text (of which the last is 30).

More ideas?

Thanks again!!

Marcus
 
M

macropod

Hi,

I'm not exactly familiar with the rtf format. But, when I bookmark a
'linked' picture (bookmark name 'PIC'), then insert a cross reference to the
bookmark, I find this in the file:
{\*\bkmkstart PIC}{\field{\*\fldinst { INCLUDEPICTURE "C:\\\\Documents and
Settings\\\\Administrator\\\\My Documents\\\\My Pictures\\\\Sample.jpg" \\*
MERGEFORMAT \\d }}{\fldrslt {}}}{{\*\bkmkend PIC}
\par }{\field{\*\fldinst {ref PIC}}{\fldrslt
{{\*\shppict{\pict{\*\picprop\shplid1032{\sp{\sn shapeType}{\sv 75}}{\sp{\sn
fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn pibFlags}{\sv 2}}{\sp{\sn
fLine}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}}

The string {\*\bkmkstart PIC}{\field{\*\fldinst { INCLUDEPICTURE
"C:\\\\Documents and Settings\\\\Administrator\\\\My Documents\\\\My
Pictures\\\\Sample.jpg" \\* MERGEFORMAT \\d }}{\fldrslt {}}}{{\*\bkmkend
PIC}
\par }
looks like the original reference to the linked picture, and the string {ref
PIC} looks to be the core of the cross-reference, but it's embedded in a lot
of other coding I don't recognise.

HTH

Cheers
 
M

Marcus

Yes, that solved my problems! Thank you very much! In my case I'm embedding
the picture rather than linking to it, so there is a lot to be gained by
just referencing to it.

For future reference, this is what I did.

Bookmarked the whole picture:
{\bkmkstart picture}{\*\shppict{\pict{\*\picprop\shplid1029{\sp{\sn
shapeType}{\sv 75}}{\sp{\sn
fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn pibFlags}{\sv 2}}{\sp{\sn
fLine}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv
1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw4
498\pich1588\picwgoal2550\pichgoal900\jpegblip\bliptag460612881{\*\blipuid
1b746511fca5c85a20a7c02ab8087455}..................picture data
here.............}}}{\bkmkend}

It can then be referenced in multiple other locations:
{\field{\*\fldinst {REF picture}}}

Thanks again!!

Marcus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top