Generating RTF code with photos

  • Thread starter Genealogy-Steve
  • Start date
G

Genealogy-Steve

I recently converted a home-grown genealogy system (Foxpro) to feed RTF code
to Word (was using Ventura) and then to PDF for distribution.
I am trying to figure out how to include pictures or other objects that I
want to appear on the documents but can't find references other than
imbedding binary code. The output can be large (>1000 pages).
Any ideas where to look are appreciated.
 
C

Cindy M.

Hi =?Utf-8?B?R2VuZWFsb2d5LVN0ZXZl?=,
I recently converted a home-grown genealogy system (Foxpro) to feed RTF code
to Word (was using Ventura) and then to PDF for distribution.
I am trying to figure out how to include pictures or other objects that I
want to appear on the documents but can't find references other than
imbedding binary code. The output can be large (>1000 pages).
Have you downloaded and studied the RTF specification available at
microsoft.com?

http://support.microsoft.com/kb/269575/en-us

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
G

Genealogy-Steve

Cindy, thanks for the reference. I have been using the 1.7 spec to help me
reverse engineer the output from Word so that I can generate the correct
codes. I have been able to meet most of my requirements. Maybe my problem
is figuring out how to convert my pictures to Hex or binary code? Also, I
was hoping to find a way to imbed a link to the image so that it was
dynamically loaded by word rather than embedded.
 
C

Cindy M.

Hi =?Utf-8?B?R2VuZWFsb2d5LVN0ZXZl?=,
Maybe my problem
is figuring out how to convert my pictures to Hex or binary code?
Can't help you with that, I'm afraid. You may need to go to a group that
deals in RTF; it's certainly beyond what this group - targeted at end-users -
provides :)
Also, I
was hoping to find a way to imbed a link to the image so that it was
dynamically loaded by word rather than embedded.
This you should be able to figure out. Save a Word document containing (only)
a linked picture (IncludePicture field containing the \d switch) as an RTF
file, then look at the syntax in a text editor. I suspect (being familiar
with how XML does it) it's not simple and straightforward, but it should
follow a strict pattern.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
G

Genealogy-Steve

Cindy, I owe you big time. Took me a bit to figure out that IncludePicture
was a field reference (I'm not a Word expert) but once I got there it quickly
was resolved. I can now proceed with my effort at real automation of my
application rather than just computerizing it.
 
G

Genealogy-Steve

Cindy,

Just a follow-up. After following your suggestion, I did a bunch more
digging in that same area and through a bunch of reverse engineering I can
generate drawing canvas's with imbedded text boxes and fields with
includepicture, including captions. I am able to use my database to generate
my genealogy reports including pictures which float on the pages with the
text.

Again, can't thank you enough. Been trying to do this for a very long time.

Steve
 
C

CyberTaz

Make sure you maintain frequent & current backup of your work ;-)

Regards |:>)
Bob Jones
[MVP] Office:Mac
 
G

Genealogy-Steve

Cindy, uncovered one more "problem" that I hope you can also help with.
As discussed, I am creating a drawing canvas containing a text box and
inserting a field using IncludePicture with the /d option.

This works fine, but when I change the size of the image to fit on the
document and save the file as a Word document, when I reopen the document the
resizing of the image is lost. Is there a way that I can specify the image
size?

The rtf code is:
\pard\plain \ql \li0\ri0\keepn \fs24 {\field\flddirty{\*\fldinst {
INCLUDEPICTURE "
C:\\\\DATA\\\\BOOK\\\\PICTURES\\\\BERGMAN\\\\EJB_21.TIF" \\* MERGEFORMATINET
\\d }}{\fldrslt }}\pard\plain \s15\qc \sb120\sa120\b\fs20 { Figure
}{\field\flddirty{\*\fldinst { SEQ Figure \\* ARABIC }}{\fldrslt {\noproof
1}}}\sectd{\par }\pard\plain\qc \fs24 {\b\fs18 Edward John Bergman\par }}}

Again, appreciate your help.
 
C

Cindy M.

Hi Steve,

No guarantees on this suggestion, but...

From the "MergeformatInet" it appears the option to update links on saving is
activated in Tools/Options/General/Web Options/File. This is a PITA and I'll
*never* understand why MS decided to turn this on by default in Word 2002 and
2003. This switch has two effects: 1. It will change the link path (and stick in
%20 for spaces); 2. It changes the way the picture size is retained to what the
Internet (HTML) expects.

Turn off the **** option. Open the document in Word. Alt+F9 to view the field
codes. Do a find/replace to get rid of \* MergeformatInet. Force the pictures to
update so they get back the linked size. Resize everything. Now put a \*
MergeFormat switch into the IncludePicture fields. This *should* have the effect
of retaining your sizing information the way WORD wants to have it.

FWIW, I had this happen to me while writing a book. After some 100 pages, I
noticed the pictures were all "funny". I had to go back and redo every single
one. Then it happened to me again, and again. I finally noticed this switch, did
some asking around about where it was coming from, wrote a scathing email to
MSFT, and keep a sharp eye out everytime I install an update or have to
configure a new installation.
Cindy, uncovered one more "problem" that I hope you can also help with.
As discussed, I am creating a drawing canvas containing a text box and
inserting a field using IncludePicture with the /d option.

This works fine, but when I change the size of the image to fit on the
document and save the file as a Word document, when I reopen the document the
resizing of the image is lost. Is there a way that I can specify the image
size?

The rtf code is:
\pard\plain \ql \li0\ri0\keepn \fs24 {\field\flddirty{\*\fldinst {
INCLUDEPICTURE "
C:\\\\DATA\\\\BOOK\\\\PICTURES\\\\BERGMAN\\\\EJB_21.TIF" \\* MERGEFORMATINET
\\d }}{\fldrslt }}\pard\plain \s15\qc \sb120\sa120\b\fs20 { Figure
}{\field\flddirty{\*\fldinst { SEQ Figure \\* ARABIC }}{\fldrslt {\noproof
1}}}\sectd{\par }\pard\plain\qc \fs24 {\b\fs18 Edward John Bergman\par }}}

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
G

Genealogy-Steve

Cindy, again I am greatful for your knowledge and responsiveness. If I can
ever repay the kindness let me know.
 

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