IWPTextCursor.InputEmbeddedData

[Top]  [Chapter]  [Previous]  [Next]

Applies to

IWPTextCursor

Declaration

int InputEmbeddedData( string imagefilename,  int Mode,string datafilename, string dataparams, int datamode);

 

This method can be used to create a certain object which can also hold binary data. The binary data will be embedded into a PDF file when the internal PDF creation (optional feature) is used.

 

It is not possible to change the image later using IWPTextObj.LoadFromStream and IWPTextObj.LoadFromFile, these methods will update the attached data, not the image. The method Contents_LoadFromFile however will update the image data.

 

 

Parameters

imagefilename

The image file, may be BMP, WMF, EMF, JPG or PNG format.

 

You can also use "pin", "graph", "tag" and "clip" to create an icon. The icon will be only displayed by Acrobat Reader after the export to PDF.

Mode

If bit 1 is set the image will be linked, not embedded.

If bit 2 is set the image will be positioned relatively to a paragraph (movable image).

If bit 3 is set the image will be positioned relatively to a page (movable image).

If bit 4 is set text will not wrap around image (if a movable image).

When bit 5 was set and the image was not found an error text object will be inserted. The error object will display <filename?>.

datafilename

The file name of the data to be attached

dataparams

Optional parameter list. You can use the parameter names contents and title.

Example: "\"Contents=this is hint text\",\"Title=Headline for the hint window\""

datamode

should be 0

Returns

0 if not successful. Otherwise the interface CurrObj can be used to change image properties.

 

C# Example

 

wpdllInt1.Memo.TextCursor.InputEmbeddedData(

   "CLIP",

   0,

   "C:\\my document.rtf",

   "\"Contents=this is hint text\",\"Title=Headline for the hint window\"",

   0);

Display in AcrobatReader

embed_some

 

You can load data from a stream in this object by using CurrObj.LoadFromStream

 

System.IO.Stream str = new System.IO.MemoryStream();

pdf.Memo.SaveToStream(

   new WPDynamic.Stream2WPStream(str) ,false,"RTF");

pdf.Memo.CurrObj.LoadFromStream("Document.RTF",

   new WPDynamic.Stream2WPStream(str));

 

 

 

 

 


[iwptextcursor_inputembeddeddat.htm]    Copyright © 2007 by WPCubed GmbH