mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-19 19:07: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;
|
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):
|
The ```PdfDocument``` will also support opening from byte arrays (as well as streams eventually):
|
||||||
|
|
||||||
|
@@ -5,13 +5,13 @@
|
|||||||
using Content;
|
using Content;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
public class SinglePageSimpleIText1Tests
|
public class SinglePageFormContentIText1Tests
|
||||||
{
|
{
|
||||||
private static string GetFilename()
|
private static string GetFilename()
|
||||||
{
|
{
|
||||||
var documentFolder = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "Integration", "Documents"));
|
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]
|
[Fact]
|
||||||
@@ -35,5 +35,16 @@
|
|||||||
Assert.Equal(PageSize.A4, page.Size);
|
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="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 google chrome print pdf.pdf" />
|
||||||
<None Remove="Integration\Documents\Font Size Test - from libre office.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 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 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" />
|
<None Remove="Integration\Documents\Single Page Simple - from open office.pdf" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<Content Include="Integration\Documents\Single Page Simple - from google drive.pdf">
|
<Content Include="Integration\Documents\Single Page Simple - from google drive.pdf">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</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>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="Integration\Documents\Single Page Simple - from open office.pdf">
|
<Content Include="Integration\Documents\Single Page Simple - from open office.pdf">
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
using Geometry;
|
using Geometry;
|
||||||
using Graphics;
|
using Graphics;
|
||||||
using IO;
|
using IO;
|
||||||
|
using Util;
|
||||||
|
|
||||||
internal class PageFactory : IPageFactory
|
internal class PageFactory : IPageFactory
|
||||||
{
|
{
|
||||||
@@ -61,6 +62,8 @@
|
|||||||
|
|
||||||
var contents = contentStream.Decode(filterProvider);
|
var contents = contentStream.Decode(filterProvider);
|
||||||
|
|
||||||
|
var txt = OtherEncodings.BytesAsLatin1String(contents);
|
||||||
|
|
||||||
var operations = pageContentParser.Parse(new ByteArrayInputBytes(contents));
|
var operations = pageContentParser.Parse(new ByteArrayInputBytes(contents));
|
||||||
|
|
||||||
var context = new ContentStreamProcessor(cropBox.Bounds, resourceStore, userSpaceUnit);
|
var context = new ContentStreamProcessor(cropBox.Bounds, resourceStore, userSpaceUnit);
|
||||||
|
Reference in New Issue
Block a user