mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-19 10:47:56 +08:00
change the itext document test to reflect its text being form content. fix readme typo
This commit is contained in:
@@ -39,7 +39,7 @@ The ```Page``` contains the page width and height in points as well as mapping t
|
||||
|
||||
PageSize size = Page.Size;
|
||||
|
||||
bool sA4 = size == PageSize.A4;
|
||||
bool isA4 = size == PageSize.A4;
|
||||
|
||||
The ```PdfDocument``` will also support opening from byte arrays (as well as streams eventually):
|
||||
|
||||
|
@@ -5,13 +5,13 @@
|
||||
using Content;
|
||||
using Xunit;
|
||||
|
||||
public class SinglePageSimpleIText1Tests
|
||||
public class SinglePageFormContentIText1Tests
|
||||
{
|
||||
private static string GetFilename()
|
||||
{
|
||||
var documentFolder = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "Integration", "Documents"));
|
||||
|
||||
return Path.Combine(documentFolder, "Single Page Simple - from itext 1_1.pdf");
|
||||
return Path.Combine(documentFolder, "Single Page Form Content - from itext 1_1.pdf");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -35,5 +35,16 @@
|
||||
Assert.Equal(PageSize.A4, page.Size);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DoesNotExtractText()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename()))
|
||||
{
|
||||
var page = document.GetPage(1);
|
||||
|
||||
Assert.Empty(page.Letters);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -12,9 +12,9 @@
|
||||
<None Remove="Fonts\TrueType\Roboto-Regular.ttf" />
|
||||
<None Remove="Integration\Documents\Font Size Test - from google chrome print pdf.pdf" />
|
||||
<None Remove="Integration\Documents\Font Size Test - from libre office.pdf" />
|
||||
<None Remove="Integration\Documents\Single Page Form Content - from itext 1_1.pdf" />
|
||||
<None Remove="Integration\Documents\Single Page Non Latin - from acrobat distiller.pdf" />
|
||||
<None Remove="Integration\Documents\Single Page Simple - from google drive.pdf" />
|
||||
<None Remove="Integration\Documents\Single Page Simple - from itext 1_1.pdf" />
|
||||
<None Remove="Integration\Documents\Single Page Simple - from open office.pdf" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<Content Include="Integration\Documents\Single Page Simple - from google drive.pdf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Integration\Documents\Single Page Simple - from itext 1_1.pdf">
|
||||
<Content Include="Integration\Documents\Single Page Form Content - from itext 1_1.pdf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Integration\Documents\Single Page Simple - from open office.pdf">
|
||||
|
@@ -8,6 +8,7 @@
|
||||
using Geometry;
|
||||
using Graphics;
|
||||
using IO;
|
||||
using Util;
|
||||
|
||||
internal class PageFactory : IPageFactory
|
||||
{
|
||||
@@ -60,7 +61,9 @@
|
||||
}
|
||||
|
||||
var contents = contentStream.Decode(filterProvider);
|
||||
|
||||
|
||||
var txt = OtherEncodings.BytesAsLatin1String(contents);
|
||||
|
||||
var operations = pageContentParser.Parse(new ByteArrayInputBytes(contents));
|
||||
|
||||
var context = new ContentStreamProcessor(cropBox.Bounds, resourceStore, userSpaceUnit);
|
||||
|
Reference in New Issue
Block a user