Example #1
0
        internal Page(int number, DictionaryToken dictionary, MediaBox mediaBox, CropBox cropBox, PageRotationDegrees rotation, PageContent content,
                      AnnotationProvider annotationProvider,
                      IPdfTokenScanner pdfScanner)
        {
            if (number <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(number), "Page number cannot be 0 or negative.");
            }

            Dictionary = dictionary ?? throw new ArgumentNullException(nameof(dictionary));

            Number   = number;
            MediaBox = mediaBox;
            CropBox  = cropBox;
            Rotation = rotation;
            Content  = content;
            textLazy = new Lazy <string>(() => GetText(Content));

            Width  = mediaBox.Bounds.Width;
            Height = mediaBox.Bounds.Height;

            Size = mediaBox.Bounds.GetPageSize();
            ExperimentalAccess      = new Experimental(this, annotationProvider);
            this.annotationProvider = annotationProvider;
            this.pdfScanner         = pdfScanner ?? throw new ArgumentNullException(nameof(pdfScanner));
        }
Example #2
0
        internal Page(int number, MediaBox mediaBox, CropBox cropBox, PageContent content)
        {
            if (number <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(number), "Page number cannot be 0 or negative.");
            }

            Number   = number;
            MediaBox = mediaBox;
            CropBox  = cropBox;
            Content  = content;
            Text     = GetText(content);

            Width  = mediaBox.Bounds.Width;
            Height = mediaBox.Bounds.Height;

            Size = mediaBox.Bounds.GetPageSize();
        }
Example #3
0
        internal Page(int number, DictionaryToken dictionary, MediaBox mediaBox, CropBox cropBox, PageContent content,
                      AnnotationProvider annotationProvider)
        {
            if (number <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(number), "Page number cannot be 0 or negative.");
            }

            Dictionary = dictionary ?? throw new ArgumentNullException(nameof(dictionary));

            Number   = number;
            MediaBox = mediaBox;
            CropBox  = cropBox;
            Content  = content;
            Text     = GetText(content);

            Width  = mediaBox.Bounds.Width;
            Height = mediaBox.Bounds.Height;

            Size = mediaBox.Bounds.GetPageSize();
            ExperimentalAccess = new Experimental(this, annotationProvider);
        }