PdfContentEditor.CreateFileAttachment

CreateFileAttachment(Rectangle, string, string, int, string)

Creates file attachment annotation.

public void CreateFileAttachment(Rectangle rect, string contents, string filePath, int page, 
    string name)
ParameterTypeDescription
rectRectangleThe annotation rectangle defining the location of the annotation on the page.
contentsStringThe contents of the annotation.
filePathStringThe path of the file will be attached.
pageInt32The number of original page where the annotation will be created.
nameStringThe name of an icon will be used in displaying the annotation. This value can be: “Graph”, “PushPin”, “Paperclip”, “Tag”.

Examples

PdfContentEditor editor = new PdfContentEditor();
editor.BindPdf("example.pdf");
editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
    "Welcome to Aspose", "attachment_file.pdf", 1, "Graph");
editor.Save("example_out.pdf");

See Also


CreateFileAttachment(Rectangle, string, string, int, string, double)

Creates file attachment annotation.

public void CreateFileAttachment(Rectangle rect, string contents, string filePath, int page, 
    string name, double opacity)
ParameterTypeDescription
rectRectangleThe annotation rectangle defining the location of the annotation on the page.
contentsStringThe contents of the annotation.
filePathStringThe path of the file will be attached.
pageInt32The number of original page where the annotation will be created.
nameStringThe name of an icon will be used in displaying the annotation. This value can be: “Graph”, “PushPin”, “Paperclip”, “Tag”.
opacityDoubleIcon’s opacity from 0 to 1: 0 - completely transparant, 1 - completely opaque.

Examples

PdfContentEditor editor = new PdfContentEditor();
editor.BindPdf("example.pdf");
editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
    "Welcome to Aspose", "attachment_file.pdf", 1, "Graph", 0.5);
editor.Save("example_out.pdf");

See Also


CreateFileAttachment(Rectangle, string, Stream, string, int, string)

Creates file attachment annotation.

public void CreateFileAttachment(Rectangle rect, string contents, Stream attachmentStream, 
    string attachmentName, int page, string name)
ParameterTypeDescription
rectRectangleThe annotation rectangle defining the location of the annotation on the page.
contentsStringThe contents of the annotation.
attachmentStreamStreamThe attachment file stream.
attachmentNameStringThe attachment name.
pageInt32The number of original page where the annotation will be created.
nameStringThe name of an icon will be used in displaying the annotation. This value can be: “Graph”, “PushPin”, “Paperclip”, “Tag”.

Examples

PdfContentEditor editor = new PdfContentEditor();
editor.BindPdf("example.pdf");
using(System.IO.FileStream attStream = System.IO.File.OpenRead("attachment_file.pdf"))
{
    editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
        "Welcome to Aspose", attStream, "attachment_file.pdf", 1, "Graph");
    editor.Save("example_out.pdf");
}

See Also


CreateFileAttachment(Rectangle, string, Stream, string, int, string, double)

Creates file attachment annotation.

public void CreateFileAttachment(Rectangle rect, string contents, Stream attachmentStream, 
    string attachmentName, int page, string name, double opacity)
ParameterTypeDescription
rectRectangleThe annotation rectangle defining the location of the annotation on the page.
contentsStringThe contents of the annotation.
attachmentStreamStreamThe attachment file stream.
attachmentNameStringThe attachment name.
pageInt32The number of original page where the annotation will be created.
nameStringThe name of an icon will be used in displaying the annotation. This value can be: “Graph”, “PushPin”, “Paperclip”, “Tag”.
opacityDoubleIcon’s opacity from 0 to 1: 0 - completely transparant, 1 - completely opaque.

Examples

PdfContentEditor editor = new PdfContentEditor();
editor.BindPdf("example.pdf");
using(System.IO.FileStream attStream = System.IO.File.OpenRead("attachment_file.pdf"))
{
    editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
        "Welcome to Aspose", attStream, "attachment_file.pdf", 1, "Graph", 0.5);
    editor.Save("example_out.pdf");
}

See Also