Hi,
I have a word document and i am adding an image to it by embedding the image in the form of a package. But when the corresponding pdf for that word is generated the embedded package containing the image is carried over as an attachment but i am not able to open it.
Here is the code that i have written for converting the embedded files:
switch (shape.OleFormat.ProgId)
{
// WordPad.Document.1 .rtf Visio.Drawing.11:.vsd
case "Excel.Sheet.8":
ext = "xls";
filenameembed = shape.OleFormat.IconCaption;
break;
case "Excel.Sheet.12":
ext = "xlsx";
filenameembed = shape.OleFormat.IconCaption;
break;
case "AcroExch.Document.7":
ext = "pdf";
filenameembed = shape.OleFormat.IconCaption;
break;
case "Word.Document.8":
ext = "doc";
filenameembed = shape.OleFormat.IconCaption;
break;
case "Word.Document.12":
ext = "docx";
filenameembed = shape.OleFormat.IconCaption;
break;
case "WordPad.Document.1":
ext = "rtf";
filenameembed = shape.OleFormat.IconCaption;
break;
case "Visio.Drawing.11":
ext = "vsd";
filenameembed = shape.OleFormat.IconCaption;
break;
default:
ext = "jpg";
filenameembed = shape.OleFormat.IconCaption;
break;
}
The ProgId for the embedded package containing the image is “Package” but since i don’t have any case for handling that, by default the ext is set as “jpg”. And therefore the file is not opening in pdf as it there is a conversion conflict (i.e., embedded package containing image is not getting converted to jpg).
Can you please suggest the extension to which the embedded package containing the image should be converted or any other solution to the problem?
PS:- When accessing the embedded package’s property in word it is showing as JPEG therefore i had set the conversion ext as jpg.