Пример #1
0
 public static void EnsureLoaded()
 {
     lock (_syncRoot)
     {
         if (_library == null)
             _library = new PdfLibrary();
     }
 }
Пример #2
0
 public static void EnsureLoaded()
 {
     lock (_syncRoot)
     {
         if (_library == null)
         {
             _library = new PdfLibrary();
         }
     }
 }
Пример #3
0
        protected PdfFile(Stream srcStream)
        {
            PdfLibrary.EnsureLoaded();
            _srcStream = srcStream;

            IntPtr ptr;

            LoadDocument(NativeMethods.FPDF_LoadCustomDocument(srcStream, null, out ptr));
            _streamptr = ptr;
        }
Пример #4
0
        public PdfFile(Stream stream, string password)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            PdfLibrary.EnsureLoaded();

            _stream = stream;
            _id     = StreamManager.Register(stream);

            var document = NativeMethods.FPDF_LoadCustomDocument(stream, password, _id);

            if (document == IntPtr.Zero)
            {
                throw new PdfException((PdfError)NativeMethods.FPDF_GetLastError());
            }

            LoadDocument(document);
        }
Пример #5
0
 protected PdfFile()
 {
     PdfLibrary.EnsureLoaded();
 }