CreateFileAttachment

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

Crée une annotation de pièce jointe.

public void CreateFileAttachment(Rectangle rect, string contents, string filePath, int page, 
    string name)
ParamètreTaperLa description
rectRectangleRectangle d’annotation définissant l’emplacement de l’annotation sur la page.
contentsStringLe contenu de l’annotation.
filePathStringLe chemin du fichier sera joint.
pageInt32Le numéro de la page d’origine où l’annotation sera créée.
nameStringLe nom d’une icône sera utilisé dans l’affichage de l’annotation. Cette valeur peut être : “Graph”, “PushPin”, “Paperclip”, “Tag”.

Exemples

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");

Voir également


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

Crée une annotation de pièce jointe.

public void CreateFileAttachment(Rectangle rect, string contents, string filePath, int page, 
    string name, double opacity)
ParamètreTaperLa description
rectRectangleRectangle d’annotation définissant l’emplacement de l’annotation sur la page.
contentsStringLe contenu de l’annotation.
filePathStringLe chemin du fichier sera joint.
pageInt32Le numéro de la page d’origine où l’annotation sera créée.
nameStringLe nom d’une icône sera utilisé dans l’affichage de l’annotation. Cette valeur peut être : “Graph”, “PushPin”, “Paperclip”, “Tag”.
opacityDoubleOpacité de l’icône de 0 à 1 : 0 - complètement transparent, 1 - complètement opaque.

Exemples

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");

Voir également


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

Crée une annotation de pièce jointe.

public void CreateFileAttachment(Rectangle rect, string contents, Stream attachmentStream, 
    string attachmentName, int page, string name)
ParamètreTaperLa description
rectRectangleRectangle d’annotation définissant l’emplacement de l’annotation sur la page.
contentsStringLe contenu de l’annotation.
attachmentStreamStreamLe flux de fichiers joints.
attachmentNameStringLe nom de la pièce jointe.
pageInt32Le numéro de la page d’origine où l’annotation sera créée.
nameStringLe nom d’une icône sera utilisé dans l’affichage de l’annotation. Cette valeur peut être : “Graph”, “PushPin”, “Paperclip”, “Tag”.

Exemples

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");
}

Voir également


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

Crée une annotation de pièce jointe.

public void CreateFileAttachment(Rectangle rect, string contents, Stream attachmentStream, 
    string attachmentName, int page, string name, double opacity)
ParamètreTaperLa description
rectRectangleRectangle d’annotation définissant l’emplacement de l’annotation sur la page.
contentsStringLe contenu de l’annotation.
attachmentStreamStreamLe flux de fichiers joints.
attachmentNameStringLe nom de la pièce jointe.
pageInt32Le numéro de la page d’origine où l’annotation sera créée.
nameStringLe nom d’une icône sera utilisé dans l’affichage de l’annotation. Cette valeur peut être : “Graph”, “PushPin”, “Paperclip”, “Tag”.
opacityDoubleOpacité de l’icône de 0 à 1 : 0 - complètement transparent, 1 - complètement opaque.

Exemples

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");
}

Voir également