Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB to VFP code
Message
De
17/11/2017 04:50:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
VB to VFP code
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01655632
Message ID:
01655632
Vues:
106
Hi All,
I need some help in converting a small VB code to VFP as I have no knowledge about VB. Anyone who is having idea kindly Guide.
Here is my Code in VB
using SignLib.Certificates;
using SignLib.Pdf;
PdfSignature ps = new PdfSignature("serial number");
//load the PDF document
ps.LoadPdfDocument("d:\\123.pdf");
ps.SignaturePage = 1;
//get the pdf page size
System.Drawing.Point page = ps.DocumentProperties.DocumentPageSize(1);
//set the rectangle width and height
int width = 80;
int height = 40;
ps.SignatureAdvancedPosition = new System.Drawing.Rectangle(page.X - width, page.Y
- height, width, height);
ps.SignaturePosition = SignaturePosition.TopRight;
ps.SigningReason = "I approve this document";
ps.SignaturePosition = SignaturePosition.TopLeft;
ps.SigningLocation = "Europe branch";
//Load the certificate from Microsoft Certificate Store without user intervention
ps.DigitalSignatureCertificate = DigitalCertificate.LoadCertificate(false,
DigitalCertificateSearchCriteria.EmailE, "email@email.com");
//The PIN dialog is now bypassed
DigitalCertificate.SmartCardPin = "123456";
//Set a Custom Digital Signature Text
ps.SignatureText ="Signed by:" + ps.DigitalSignatureCertificate.GetNameInfo(X509NameType.SimpleName,
false) + "\n Date:" + DateTime.Now.ToString("yyyy.MM.dd HH:mm") + "\n" + "Reason:" + ps.SigningReason;
ps.FontFile = "c:\\windows\\fonts\\arial.ttf";
ps.FontSize = 10;
//Set the Digital Signature Image
ps.SignatureImage = System.IO.File.ReadAllBytes("c:\\graphic.jpg");
//text on the right and image on the left
ps.SignatureImageType = SignatureImageType.ImageAndText;
//image as bakground and text on above
ps.SignatureImageType = SignatureImageType.ImageAsBackground;
//only image
ps.SignatureImageType = SignatureImageType.ImageWithNoText;
//write the signed file
File.WriteAllBytes("d:\\source[signed].pdf", ps.ApplyDigitalSignature());
Thanks
Harsh
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform