Gets the content type for the specified page of this PDFDocument.
public Leadtools.Pdf.PDFContentType GetContentType(
int pageNumber
)
Public Function GetContentType( _
ByVal pageNumber As Integer _
) As Leadtools.Pdf.PDFContentType
public PDFContentType getContentType(int pageNumber)
public:
Leadtools.Pdf.PDFContentType GetContentType(
int pageNumber
)
pageNumber
The page number to check.
A PDFContentType that indicates the content type for the specified page.
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Controls
Imports Leadtools.Pdf
Imports Leadtools.Svg
Imports Leadtools.WinForms
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;
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";
}
Products |
Support |
Feedback: GetContentType Method - Leadtools.Pdf |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.