diff --git a/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs b/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs index 51891316..a97a3ddf 100644 --- a/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs +++ b/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs @@ -56,6 +56,11 @@ public byte[] Sign(byte[] message, out byte[] timeStampResponse) { RSACng rsa = (RSACng)digitalID.PrivateKey; return rsa.SignData(message, System.Security.Cryptography.HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); } + else if (digitalID.PrivateKey is System.Security.Cryptography.RSAOpenSsl) + { + System.Security.Cryptography.RSAOpenSsl rsa = (System.Security.Cryptography.RSAOpenSsl)digitalID.PrivateKey; + return rsa.SignData(message, System.Security.Cryptography.HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); + } return null; } } diff --git a/Text Extraction/Get-text-glyph-details-from-extract-text/.NET/Get-text-glyph-details-from-extract-text/Program.cs b/Text Extraction/Get-text-glyph-details-from-extract-text/.NET/Get-text-glyph-details-from-extract-text/Program.cs index 5cc96b09..9c6181ee 100644 --- a/Text Extraction/Get-text-glyph-details-from-extract-text/.NET/Get-text-glyph-details-from-extract-text/Program.cs +++ b/Text Extraction/Get-text-glyph-details-from-extract-text/.NET/Get-text-glyph-details-from-extract-text/Program.cs @@ -1,38 +1,40 @@ using Syncfusion.Drawing; using Syncfusion.Pdf; using Syncfusion.Pdf.Parsing; +using System.IO; //Get stream from an existing PDF document. FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read); -//Load the existing PDF document. +// Load the existing PDF document PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream); -//Get the first page of the loaded PDF document +// Get the first page of the loaded PDF document PdfPageBase page = loadedDocument.Pages[0]; TextLineCollection lineCollection = new TextLineCollection(); -//Extract text from the first page -string m_extractedText = page.ExtractText(out lineCollection); -//Gets specific line from the collection + +// Extract text from the first page +string extractedText = page.ExtractText(out lineCollection); +// Get a specific line from the collection TextLine line = lineCollection.TextLine[0]; -//Gets collection of the words in the line +// Get the collection of words in the line List textWordCollection = line.WordCollection; -//Gets word from the collection using index +// Get a word from the collection using an index TextWord textWord = textWordCollection[0]; -// Gets Glyph details of the word +// Get Glyph details of the word List textGlyphCollection = textWord.Glyphs; -//Gets character of the word + +// Get a character from the word TextGlyph textGlyph = textGlyphCollection[0]; -//Gets bounds of the character +// Get bounds of the character RectangleF glyphBounds = textGlyph.Bounds; -//Gets font name of the character -string GlyphFontName = textGlyph.FontName; -//Gets font size of the character -float GlyphFontSize = textGlyph.FontSize; -//Gets font style of the character -FontStyle GlyphFontStyle = textGlyph.FontStyle; -//Gets character in the word -char GlyphText = textGlyph.Text; -//Gets the color of the character -Color GlyphColor = textGlyph.TextColor; -//Close the document -loadedDocument.Close(true); \ No newline at end of file +// Get font name of the character +string glyphFontName = textGlyph.FontName; +// Get font size of the character +float glyphFontSize = textGlyph.FontSize; +// Get font style of the character +FontStyle glyphFontStyle = textGlyph.FontStyle; +// Get the character in the word +char glyphText = textGlyph.Text; +// Get the color of the character +Color glyphColor = textGlyph.TextColor; +loadedDocument.Close();