Beispiel #1
0
        /* ----------------------------------------------------------------- */
        ///
        /// GetRawReader
        ///
        /// <summary>
        /// Gets the PdfReader corresponding to the specified PDF file.
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private PdfReader GetRawReader(PdfFile src)
        {
            var key = src.FullName;

            if (_hints.TryGetValue(key, out var hit))
            {
                return(hit);
            }

            var options = new OpenOption {
                IO = IO, SaveMemory = false
            };
            var reader = new DocumentReader(key, src.Password, options);

            _resources.Add(reader);
            _hints.Add(key, reader.Core);

            return(reader.Core);
        }
        /* ----------------------------------------------------------------- */
        ///
        /// GetRawReader
        ///
        /// <summary>
        /// Gets the PdfReader corresponding to the specified PDF file.
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private PdfReader GetRawReader(PdfFile file)
        {
            var key = file.FullName;

            if (_hints.TryGetValue(key, out var hit))
            {
                return(hit);
            }

            var reader = new DocumentReader(key, file.Password, false, IO);

            _resources.Add(reader);

            var dest = reader.RawObject.TryCast <PdfReader>();

            Debug.Assert(dest != null);
            _hints.Add(key, dest);

            return(dest);
        }
Beispiel #3
0
 /* ----------------------------------------------------------------- */
 ///
 /// GetEmbeddedImages
 ///
 /// <summary>
 /// Gets the collection of embedded images in the specified page.
 /// </summary>
 ///
 /// <param name="src">Document reader.</param>
 /// <param name="pagenum">Page number.</param>
 ///
 /// <returns>Collection of embedded images.</returns>
 ///
 /* ----------------------------------------------------------------- */
 public static IEnumerable <Image> GetEmbeddedImages(this DocumentReader src, int pagenum) =>
 src.Core.GetContentParser().ProcessContent(pagenum, new EmbeddedImageCollection());