make filter provider and filter public and use tryget for image bytes

This commit is contained in:
Eliot Jones
2020-04-25 09:42:24 +01:00
parent 635c4b4c5e
commit 27e251f921
12 changed files with 108 additions and 35 deletions

View File

@@ -1,6 +1,5 @@
namespace UglyToad.PdfPig.Tests.Integration
{
using System;
using System.Linq;
using Xunit;
@@ -74,13 +73,12 @@
var page = document.GetPage(1);
foreach (var image in page.GetImages())
{
try
if (image.TryGetBytes(out var bytes))
{
Assert.NotNull(image.Bytes);
Assert.NotNull(bytes);
}
catch (NotSupportedException )
else
{
// Should allow access to raw bytes.
Assert.NotNull(image.RawBytes);
}
}

View File

@@ -85,6 +85,9 @@
"UglyToad.PdfPig.CrossReference.CrossReferenceType",
"UglyToad.PdfPig.CrossReference.TrailerDictionary",
"UglyToad.PdfPig.Exceptions.PdfDocumentEncryptedException",
"UglyToad.PdfPig.Filters.DefaultFilterProvider",
"UglyToad.PdfPig.Filters.IFilter",
"UglyToad.PdfPig.Filters.IFilterProvider",
"UglyToad.PdfPig.PdfFonts.DescriptorFontFile",
"UglyToad.PdfPig.PdfFonts.FontDescriptor",
"UglyToad.PdfPig.PdfFonts.FontDescriptorFlags",
@@ -192,6 +195,7 @@
"UglyToad.PdfPig.Outline.Destinations.ExplicitDestinationType",
"UglyToad.PdfPig.ParsingOptions",
"UglyToad.PdfPig.PdfDocument",
"UglyToad.PdfPig.PdfExtensions",
"UglyToad.PdfPig.Structure",
"UglyToad.PdfPig.Util.Adler32Checksum",
"UglyToad.PdfPig.Util.IWordExtractor",