Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.3.23
|
Leadtools.Pdf Assembly > Leadtools.Pdf Namespace > PDFDocument Class : GetContentType Method |
public PDFContentType GetContentType( int pageNumber )
'Declaration
Public Function GetContentType( _ ByVal pageNumber As Integer _ ) As PDFContentType
'Usage
Dim instance As PDFDocument Dim pageNumber As Integer Dim value As PDFContentType value = instance.GetContentType(pageNumber)
public PDFContentType getContentType(int pageNumber)
public: PDFContentType GetContentType( int pageNumber )
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.Controls Imports Leadtools.Pdf Imports Leadtools.Svg Imports Leadtools.WinForms <TestMethod> _ Public Sub PDFDocumentGetContentTypeExample() Dim pdfFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Leadtools.pdf") Dim txtFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "LEAD_pdfContent.txt") ' Save the results to the text file for examining Using writer As StreamWriter = File.CreateText(txtFileName) Using document As PDFDocument = New PDFDocument(pdfFileName) For Each page As PDFDocumentPage In document.Pages Dim contentType As PDFContentType = document.GetContentType(page.PageNumber) writer.WriteLine("Page {0}: {1}", page.PageNumber, contentType.ToString()) Next page End Using End Using End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
using Leadtools; using Leadtools.Codecs; using Leadtools.Controls; using Leadtools.Pdf; using Leadtools.Svg; using Leadtools.WinForms; [TestMethod] public void PDFDocumentGetContentTypeExample() { string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); string txtFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD_pdfContent.txt"); // Save the results to the text file for examining using (StreamWriter writer = File.CreateText(txtFileName)) using (PDFDocument document = new PDFDocument(pdfFileName)) foreach (PDFDocumentPage page in document.Pages) { PDFContentType contentType = document.GetContentType(page.PageNumber); writer.WriteLine("Page {0}: {1}", page.PageNumber, contentType.ToString()); } } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }