Hello Aspose,
I would like to join an attachment and a image so that it looks like one image (the pin appears in top/left corner of the image). Please see the upload PDF.
To reach this I did this:
private static void Main(string[] args) { Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add();Table table1 = new Table();
sec1.Paragraphs.Add( table1 );
table1.DefaultCellBorder = new BorderInfo( (int) BorderSide.All, new Aspose.Pdf.Generator.Color( “LightSkyBlue” ) );
table1.ColumnAdjustment = ColumnAdjustmentType.AutoFitToContent;Row row1 = table1.Rows.Add();
Cell cell1Row1 = row1.Cells.Add();
Attachment fileAttachment = new Attachment();
cell1Row1.Paragraphs.Add( fileAttachment );
fileAttachment.AttachmentType = AttachmentType.File;
fileAttachment.AttachedFileName = @“F:\tfs\Entwicklung\bin\x86\Debug\DemoImage”;
fileAttachment.AttachedFileType = “jpg”;
fileAttachment.FileIconType = FileIconType.PushPin;
fileAttachment.IconColor = new Color( “Brown” );
fileAttachment.NoteContent = “Attachment 1”;Cell cell2Row1 = row1.Cells.Add();
Image fileAttachment2 = new Image();
cell2Row1.Paragraphs.Add( fileAttachment2 );
fileAttachment2.ImageInfo.ImageFileType = ImageFileType.Jpeg;
fileAttachment2.ImageInfo.File = @“F:\tfs\Entwicklung\bin\x86\Debug\DemoImage”;pdf1.Save( args[1] );
}
The result is exaclty what I want, but it seems to me that this is not your expected result. So I’m afraid of a future bug-fix.
Could you please tell me or how to reach that correctly.
Regards
Gerd