Program.cs 636 B

1234567891011121314151617181920212223242526
  1. #region Perparation work
  2. using ComPDFKit.PDFDocument;
  3. Console.WriteLine("Running Stream Load test sample…\r\n");
  4. bool statue = SDKLicenseHelper.LicenseVerify();
  5. #endregion
  6. #region Sample 1: Open Local File With Stream
  7. if (statue && File.Exists("PDF32000_2008.pdf"))
  8. {
  9. FileStream fs = File.OpenRead("PDF32000_2008.pdf");
  10. CPDFDocument pdfDoc = CPDFDocument.InitWithStream(fs);
  11. if (pdfDoc != null)
  12. {
  13. Console.WriteLine("Load File With Stream Done.");
  14. pdfDoc.Release();
  15. fs.Close();
  16. }
  17. }
  18. #endregion
  19. Console.WriteLine("Done.");
  20. Console.WriteLine("--------------------");
  21. Console.ReadLine();