简体   繁体   中英

Custom metadata in RTF picture?

I need to be able to identify pictures in a valid RTF string.

Picture example:

{\pict\wmetafile8\picw503\pich476\picwgoal285\pichgoal270
010009000003fe0200000000d502000000000400000003010800050000000b0200000000050000
000c0212001300030000001e0004000000070104000400000007010400d5020000410b2000cc00
120013000000000012001300000000002800000013000000120000000100080000000000000000
... more hex here ...
002701ffff030000000000
}

I am using RTF 1.6 and the editor I display the content in needs valid rtf code.

I need to be able to identify the images and replace them placeholders when transferring the content between the server and the client. For this I am thinking of using regular expressions to replace the images with string placeholders.

Is there a way to identify the image using custom metadata fields?

After re-reading the RTF 1.6 documentation I found that this is possible.

The 1.6 spec allows you to identify an image inside an RTF document using two attributes: \\bliptagN and \\blipuid XXXXX .

Unfortunately this doesn't work in my particular case. I am using an instance of the RichTextBox class to show the content to the user.

It turns out the RichTextBox control doesn't support the full RTF 1.6 specification and automatically cleans all non-supported metadata when inserting a picture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM