logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Thursday, June 23, 2022 8:24:57 AM(UTC)
 
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();
adammckay Posted: Wednesday, June 22, 2022 3:57:56 PM(UTC)
 
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.