Sign
Sign(int, string, string, string, bool, Rectangle)
Hacer una firma en el documento pdf.
public void Sign(int page, string SigReason, string SigContact, string SigLocation, bool visible,
Rectangle annotRect)
Parámetro | Escribe | Descripción |
---|---|---|
page | Int32 | El número de página en la que se realiza la firma. |
SigReason | String | El motivo de la firma. |
SigContact | String | El contacto de la firma. |
SigLocation | String | La ubicación de la firma. |
visible | Boolean | La visibilidad de la firma. |
annotRect | Rectangle | El recto de la firma. |
Ejemplos
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PdfFileSignature pdfSign = new PdfFileSignature();
pdfSign.BindPdf(inFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 200);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.SetCertificate("certificate.pfx", "password");
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect);
pdfSign.Save(outFile);
[Visual Basic]
Dim pdfSign = new PdfFileSignature()
pdfSign.BindPdf(inFile)
Dim rect as System.Drawing.Rectangle = new System.Drawing.Rectangle(100, 100, 200, 200)
pdfSign.SetCertificate("certificate.pfx", "password")
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect)
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg"
pdfSign.Save(outFile)
Ver también
- class PdfFileSignature
- espacio de nombres Aspose.Pdf.Facades
- asamblea Aspose.PDF
Sign(int, string, string, string, bool, Rectangle, Signature)
Firma el documento con el tipo de firma dado.
public void Sign(int page, string SigReason, string SigContact, string SigLocation, bool visible,
Rectangle annotRect, Signature sig)
Parámetro | Escribe | Descripción |
---|---|---|
page | Int32 | El número de página en la que se realiza la firma. |
SigReason | String | El motivo de la firma. |
SigContact | String | El contacto de la firma. |
SigLocation | String | La ubicación de la firma. |
visible | Boolean | La visibilidad de la firma. |
annotRect | Rectangle | El recto de la firma. |
sig | Signature | El tipo de firma, podría ser PKCS1, PKCS7 y PKCS7Detached. |
Ejemplos
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect, new PKCS1("certificate.pfx", "password"));
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath & "example1.pdf"
Dim outFile As String = TestPath & "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
Dim pdfSign = new PdfFileSignature(inFile, outFile)
Dim rect as System.Drawing.Rectangle = new System.Drawing.Rectangle(100, 100, 200, 100)
pdfSign.SignatureAppearance = TestPath & "butterfly.jpg"
pdfSign.Sign(2, "Allen", "success", "ChangSha", true, rect, sig)
pdfSign.Save()
Ver también
- class Signature
- class PdfFileSignature
- espacio de nombres Aspose.Pdf.Facades
- asamblea Aspose.PDF
Sign(int, bool, Rectangle, Signature)
Firma el documento con el tipo de firma dado.
public void Sign(int page, bool visible, Rectangle annotRect, Signature sig)
Parámetro | Escribe | Descripción |
---|---|---|
page | Int32 | El número de página en la que se realiza la firma. |
visible | Boolean | La visibilidad de la firma. |
annotRect | Rectangle | El recto de la firma. |
sig | Signature | El tipo de firma, podría ser PKCS1, PKCS7 y PKCS7Detached. Los datos como el motivo de la firma, el contacto y la ubicación ya deben estar presentes en este objeto (consulte las propiedades correspondientes). |
Ejemplos
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PKCS1 sig = new PKCS1("certificate.pfx", "password");
sig.Reason = "Some reason";
sig.Contact = "Smith";
sig.Location = "New York";
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign(2, true, rect, sig);
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath & "example1.pdf"
Dim outFile As String = TestPath & "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
sig.Reason = "Some reason"
sig.Contact = "Smith"
sig.Location = "New York"
Dim pdfSign = new PdfFileSignature(inFile, outFile)
Dim rect as System.Drawing.Rectangle = new System.Drawing.Rectangle(100, 100, 200, 100)
pdfSign.SignatureAppearance = TestPath & "butterfly.jpg"
pdfSign.Sign(2, true, rect, sig)
pdfSign.Save()
Ver también
- class Signature
- class PdfFileSignature
- espacio de nombres Aspose.Pdf.Facades
- asamblea Aspose.PDF
Sign(string, string, string, string, Signature)
Firme el documento con el tipo de firma dado que se coloca en el campo de firma ya presentado. Antes de firmar, el campo de firma debe estar vacío, es decir, el campo no debe contener el diccionario de firma. Por lo tanto, el documento pdf ya tiene un campo de firma, no debe proporcionar el lugar para estampar la firma, se toman la página y el rectángulo correspondientes del campo de firma que se encuentra por nombre de firma (consulte el parámetro SigName).
public void Sign(string SigName, string SigReason, string SigContact, string SigLocation,
Signature sig)
Parámetro | Escribe | Descripción |
---|---|---|
SigName | String | El nombre del campo de la firma. |
SigReason | String | El motivo de la firma. |
SigContact | String | El contacto de la firma. |
SigLocation | String | La ubicación de la firma. |
sig | Signature | El tipo de firma, podría ser PKCS1, PKCS7 y PKCS7Detached. |
Ejemplos
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PKCS1 sig = new PKCS1("certificate.pfx", "password");
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign("Signature1", "Allen", "success", "ChangSha", sig);
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath & "example1.pdf"
Dim outFile As String = TestPath & "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
Dim pdfSign = new PdfFileSignature(inFile, outFile)
pdfSign.SignatureAppearance = TestPath & "butterfly.jpg"
pdfSign.Sign("Signature1", "Allen", "success", "ChangSha", sig)
pdfSign.Save()
Ver también
- class Signature
- class PdfFileSignature
- espacio de nombres Aspose.Pdf.Facades
- asamblea Aspose.PDF
Sign(int, string, string, string, string, bool, Rectangle, Signature)
Firme el documento con el tipo de firma dado que se coloca en el campo de firma ya presentado. Antes de firmar, el documento pdf ya debe tener un campo de firma, la página y el rectángulo correspondientes se toman del campo de firma que se encuentra por nombre de firma (consulte el parámetro SigName) .
public void Sign(int page, string SigName, string SigReason, string SigContact, string SigLocation,
bool visible, Rectangle annotRect, Signature sig)
Parámetro | Escribe | Descripción |
---|---|---|
page | Int32 | El número de página en la que se realiza la firma. |
SigName | String | El nombre del campo de la firma. |
SigReason | String | El motivo de la firma. |
SigContact | String | El contacto de la firma. |
SigLocation | String | La ubicación de la firma. |
visible | Boolean | La visibilidad de la firma. |
annotRect | Rectangle | El recto de la firma. |
sig | Signature | El tipo de firma, podría ser PKCS1, PKCS7 y PKCS7Detached. |
Ejemplos
[C#]
string inFile = TestPath + "blankWithSignature.pdf";
string outFile = TestPath + "signature.pdf";
PKCS7 sig = new PKCS7("certificate.pfx", "password");
PdfFileSignature pdfSign = new PdfFileSignature(inFile);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 100, 100);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg"
pdfSign.Sign(1, "Signature1", "ReasonToTest", "ContactMe", "SomeLocation", true, rect, sig);
pdfSign.Save(outFile);
[Visual Basic]
Dim inFile As String = TestPath & "blankWithSignature.pdf"
Dim outFile As String = TestPath & "signature.pdf"
Dim sig As PKCS7 = new PKCS7("certificate.pfx", "password")
Dim pdfSign = new PdfFileSignature(inFile, outFile)
pdfSign.SignatureAppearance = TestPath & "butterfly.jpg"
pdfSign.Sign("Signature1", "ReasonToTest", "ContactMe", "SomeLocation", true, rect, sig)
pdfSign.Save(outFile)
Ver también
- class Signature
- class PdfFileSignature
- espacio de nombres Aspose.Pdf.Facades
- asamblea Aspose.PDF
Sign(string, Signature)
Firme el documento con el tipo de firma dado que se coloca en el campo de firma ya presentado. Antes de firmar, el campo de firma debe estar vacío, es decir, el campo no debe contener el diccionario de firma. Por lo tanto, el documento pdf ya tiene un campo de firma, no debe proporcionar el lugar para sellar la firma, la página y el rectángulo correspondientes se toman del campo de firma que se encuentra por nombre de firma (consulte el parámetro SigName).
public void Sign(string SigName, Signature sig)
Parámetro | Escribe | Descripción |
---|---|---|
SigName | String | El nombre del campo de la firma. |
sig | Signature | El tipo de firma podría ser PKCS1 (objeto Pkcs1Signature), PKCS7 y PKCS7 separados (objeto Pkcs7Signature) |
Ejemplos
[C#]
string inFile = TestPath + "example1.pdf";
string outFile = TestPath + "signature.pdf";
PKCS1 sig = new PKCS1("certificate.pfx", "password");
sig.Reason = "Some reason";
sig.Contact = "Smith";
sig.Location = "New York";
PdfFileSignature pdfSign = new PdfFileSignature(inFile, outFile);
pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";
pdfSign.Sign("Signature1", sig);
pdfSign.Save();
[Visual Basic]
Dim inFile As String = TestPath & "example1.pdf"
Dim outFile As String = TestPath & "signature.pdf"
Dim sig As PKCS1 = new PKCS1("certificate.pfx", "password")
sig.Reason = "Some reason"
sig.Contact = "Smith"
sig.Location = "New York"
Dim pdfSign = new PdfFileSignature(inFile, outFile)
pdfSign.SignatureAppearance = TestPath & "butterfly.jpg"
pdfSign.Sign("Signature1", sig)
pdfSign.Save()
Ver también
- class Signature
- class PdfFileSignature
- espacio de nombres Aspose.Pdf.Facades
- asamblea Aspose.PDF