예제 #1
0
파일: Page.cs 프로젝트: hello-web/PdfPig
        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));
        }
예제 #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();
        }
예제 #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);
        }