Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB to VFP code
Message
From
17/11/2017 06:13:55
 
 
To
17/11/2017 04:50:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01655632
Message ID:
01655633
Views:
89
Hi Harsh,

first step is to instantiate the classes, then the rest should be very similar.

based on http://www.signfiles.com/manuals/SignatureLibraryUserManual.pdf, it's a .net software;
then you need an adapter such as wwDotNetBridge (https://west-wind.com/wwDotnetBridge.aspx).

>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
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform