|
Hi, There is no property for check for FPDFA. The Pdf Availability Provider must be used to check the linearization. Here is an example of how to load an existing PDF document into a PDF viewer using the PdfAvailabilityProvider class. Code:
string pathToPdf = @"e:\0\1gb\test_big.pdf";
PdfCommon.Initialize();
var pdfFile = System.IO.File.OpenRead(pathToPdf);
var provider = new PdfAvailabilityProvider((int)new System.IO.FileInfo(pathToPdf).Length);
provider.AddSegment += (sender, e) =>
{
};
provider.IsSegmentAvailable += (sender, e) =>
{
e.IsSegmentAvailable = true;
};
provider.ReadSegment += (sender, e) =>
{
pdfFile.Seek(e.SegmentOffset, System.IO.SeekOrigin.Begin);
pdfFile.Read(e.DstBuffer, 0, e.SegmentSize);
e.IsSuccess = true;
};
var linstate = provider.IsLinearized;
while (!provider.IsDocumentAvailable) ;
provider.CreateDocument();
while (provider.IsFormAvailable == Patagames.Pdf.Enums.IsFormAvailableResults.NotAvaialble) ;
var forms = provider.IsFormAvailable == IsFormAvailableResults.Available ? new PdfForms() : null;
provider.InitDocument(forms);
pdfViewer1.Document = provider.Document;
After calling PdfViewer.CloseDocument() or setting the pdfviewer1.Document property to null, you also need to dispose the provider and close the file. Code:pdfViewer1.CloseDocument(); // or pdfViewer1.Document = null;
provider.Dispose();
pdfFile.Close();
|
|
We are using the Pdfium.NET SDK in a VB.NET solution. I have worked out the code to load Initilize and load a PDF document from disk. The Resulting PDF object has a lot of obvious properties like Author, Subject, etc. that are easy to access. I do not see any properties or methods to detect if the document is linearized. For that matter, I see nothing to check if the document is a PDFA. I read and searched the SDK. I see that there is an AccessiblityProvider to check for linearization but it seems to only exist for new documents. It is not clear what that is for and how to use it (if that's even the right direction here). As for PDFA, I can find nothing.
Any help would be appreciated.
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close