mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 19:54:52 +08:00
change the project name to something silly
This commit is contained in:
@@ -6,4 +6,4 @@ nuget restore packages.config -PackagesDirectory .
|
||||
|
||||
cd ..
|
||||
|
||||
CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test UglyToad.Pdf.Tests\UglyToad.Pdf.Tests.csproj --framework netcoreapp2.0 -c debug" -register:user -output:.\test-results.xml -hideskipped:All -returntargetcode -oldStyle -filter:"+[UglyToad.Pdf*]* -[UglyToad.Pdf.Tests*]*"
|
||||
CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test UglyToad.PdfPig.Tests\UglyToad.PdfPig.Tests.csproj --framework netcoreapp2.0 -c debug" -register:user -output:.\test-results.xml -hideskipped:All -returntargetcode -oldStyle -filter:"+[UglyToad.PdfPig*]* -[UglyToad.PdfPig.Tests*]*"
|
||||
|
@@ -1,219 +0,0 @@
|
||||
namespace UglyToad.Pdf.Parser.FileStructure
|
||||
{
|
||||
namespace UglyToad.Pdf.Parser.Parts.CrossReference
|
||||
{
|
||||
using System;
|
||||
using ContentStream;
|
||||
using ContentStream.TypedAccessors;
|
||||
using Cos;
|
||||
using global::UglyToad.Pdf.Parser.Parts;
|
||||
using global::UglyToad.Pdf.Parser.Parts.CrossReference;
|
||||
using IO;
|
||||
using Logging;
|
||||
using Util;
|
||||
|
||||
internal class OldCrossReferenceTableParser
|
||||
{
|
||||
private const string InUseEntry = "n";
|
||||
private const string FreeEntry = "f";
|
||||
|
||||
private readonly ILog log;
|
||||
private readonly IDictionaryParser dictionaryParser;
|
||||
private readonly IBaseParser baseParser;
|
||||
|
||||
public OldCrossReferenceTableParser(ILog log, IDictionaryParser dictionaryParser, IBaseParser baseParser)
|
||||
{
|
||||
this.log = log;
|
||||
this.dictionaryParser = dictionaryParser;
|
||||
this.baseParser = baseParser;
|
||||
}
|
||||
|
||||
public bool TryParse(IRandomAccessRead source, long offset, bool isLenientParsing, CosObjectPool pool, out CrossReferenceTablePartBuilder builder)
|
||||
{
|
||||
builder = null;
|
||||
|
||||
var tableStartOffset = source.GetPosition();
|
||||
|
||||
if (source.Peek() != 'x')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var xref = ReadHelper.ReadString(source);
|
||||
if (!xref.Trim().Equals("xref"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check for trailer after xref
|
||||
var str = ReadHelper.ReadString(source);
|
||||
byte[] b = OtherEncodings.StringAsLatin1Bytes(str);
|
||||
|
||||
source.Rewind(b.Length);
|
||||
|
||||
if (str.StartsWith("trailer"))
|
||||
{
|
||||
log.Warn("skipping empty xref table");
|
||||
return false;
|
||||
}
|
||||
|
||||
builder = new CrossReferenceTablePartBuilder
|
||||
{
|
||||
Offset = offset,
|
||||
XRefType = CrossReferenceType.Table
|
||||
};
|
||||
|
||||
// Tables can have multiple sections. Each starts with a starting object id and a count.
|
||||
while (true)
|
||||
{
|
||||
if (!TableSubsectionDefinition.TryRead(log, source, out var subsectionDefinition))
|
||||
{
|
||||
log.Warn($"Unexpected subsection definition in the cross-reference table at offset {offset}");
|
||||
|
||||
if (isLenientParsing)
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var currentObjectId = subsectionDefinition.FirstNumber;
|
||||
|
||||
ReadHelper.SkipSpaces(source);
|
||||
for (var i = 0; i < subsectionDefinition.Count; i++)
|
||||
{
|
||||
if (source.IsEof() || ReadHelper.IsEndOfName((char)source.Peek()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (source.Peek() == 't')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
//Ignore table contents
|
||||
var currentLine = ReadHelper.ReadLine(source);
|
||||
var splitString = currentLine.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (splitString.Length < 3)
|
||||
{
|
||||
log.Warn("invalid xref line: " + currentLine);
|
||||
break;
|
||||
}
|
||||
|
||||
// This supports the corrupt table as reported in PDFBOX-474 (XXXX XXX XX n)
|
||||
if (splitString[splitString.Length - 1].Equals(InUseEntry))
|
||||
{
|
||||
try
|
||||
{
|
||||
var objectOffset = long.Parse(splitString[0]);
|
||||
|
||||
if (objectOffset >= tableStartOffset && objectOffset <= source.GetPosition())
|
||||
{
|
||||
// PDFBOX-3923: offset points inside this table - that can't be good
|
||||
throw new InvalidOperationException(
|
||||
$"Object offset {objectOffset} is within its own cross-reference table for object {currentObjectId}");
|
||||
}
|
||||
|
||||
var generation = int.Parse(splitString[1]);
|
||||
builder.Add(currentObjectId, generation, objectOffset);
|
||||
}
|
||||
catch (FormatException e)
|
||||
{
|
||||
throw new InvalidOperationException("Bad", e);
|
||||
}
|
||||
}
|
||||
else if (!splitString[2].Equals(FreeEntry))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Corrupt cross-reference table entry for object {currentObjectId}. The indicator was not 'n' or 'f' but {splitString[2]}.");
|
||||
}
|
||||
|
||||
currentObjectId++;
|
||||
|
||||
ReadHelper.SkipSpaces(source);
|
||||
}
|
||||
|
||||
ReadHelper.SkipSpaces(source);
|
||||
if (!ReadHelper.IsDigit(source))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!TryParseTrailer(source, isLenientParsing, pool, out var trailer))
|
||||
{
|
||||
throw new InvalidOperationException($"Something went wrong trying to read the XREF table at {offset}.");
|
||||
}
|
||||
|
||||
builder.Dictionary = trailer;
|
||||
builder.Previous = trailer.GetLongOrDefault(CosName.PREV);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryParseTrailer(IRandomAccessRead source, bool isLenientParsing, CosObjectPool pool, out PdfDictionary trailer)
|
||||
{
|
||||
trailer = null;
|
||||
// parse the last trailer.
|
||||
var trailerOffset = source.GetPosition();
|
||||
// PDFBOX-1739 skip extra xref entries in RegisSTAR documents
|
||||
if (isLenientParsing)
|
||||
{
|
||||
int nextCharacter = source.Peek();
|
||||
while (nextCharacter != 't' && ReadHelper.IsDigit(nextCharacter))
|
||||
{
|
||||
if (source.GetPosition() == trailerOffset)
|
||||
{
|
||||
// warn only the first time
|
||||
//LOG.warn("Expected trailer object at position " + trailerOffset
|
||||
// + ", keep trying");
|
||||
}
|
||||
ReadHelper.ReadLine(source);
|
||||
nextCharacter = source.Peek();
|
||||
}
|
||||
}
|
||||
if (source.Peek() != 't')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//read "trailer"
|
||||
long currentOffset = source.GetPosition();
|
||||
string nextLine = ReadHelper.ReadLine(source);
|
||||
if (!nextLine.Trim().Equals("trailer"))
|
||||
{
|
||||
// in some cases the EOL is missing and the trailer immediately
|
||||
// continues with "<<" or with a blank character
|
||||
// even if this does not comply with PDF reference we want to support as many PDFs as possible
|
||||
// Acrobat reader can also deal with this.
|
||||
if (nextLine.StartsWith("trailer"))
|
||||
{
|
||||
// we can't just unread a portion of the read data as we don't know if the EOL consist of 1 or 2 bytes
|
||||
int len = "trailer".Length;
|
||||
// jump back right after "trailer"
|
||||
source.Seek(currentOffset + len);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// in some cases the EOL is missing and the trailer continues with " <<"
|
||||
// even if this does not comply with PDF reference we want to support as many PDFs as possible
|
||||
// Acrobat reader can also deal with this.
|
||||
ReadHelper.SkipSpaces(source);
|
||||
|
||||
PdfDictionary parsedTrailer = dictionaryParser.Parse(source, baseParser, pool);
|
||||
|
||||
trailer = parsedTrailer;
|
||||
|
||||
ReadHelper.SkipSpaces(source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("UglyToad.Pdf.Tests")]
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.ContentStream
|
||||
namespace UglyToad.PdfPig.Tests.ContentStream
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Util;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Util;
|
||||
using Xunit;
|
||||
|
||||
public class PdfBooleanTests
|
@@ -1,7 +1,7 @@
|
||||
namespace UglyToad.Pdf.Tests.Core
|
||||
namespace UglyToad.PdfPig.Tests.Core
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using Pdf.Core;
|
||||
using PdfPig.Core;
|
||||
using Xunit;
|
||||
|
||||
public class TransformationMatrixTests
|
@@ -1,9 +1,9 @@
|
||||
// ReSharper disable ObjectCreationAsStatement
|
||||
namespace UglyToad.Pdf.Tests.Cos
|
||||
namespace UglyToad.PdfPig.Tests.Cos
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Pdf.Cos;
|
||||
using PdfPig.Cos;
|
||||
using Xunit;
|
||||
|
||||
public class CosObjectKeyTests
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Filters
|
||||
namespace UglyToad.PdfPig.Tests.Filters
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Filters;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Filters;
|
||||
using Xunit;
|
||||
|
||||
public class Ascii85FilterTests
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Filters
|
||||
namespace UglyToad.PdfPig.Tests.Filters
|
||||
{
|
||||
using System;
|
||||
using System.Text;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Filters;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Filters;
|
||||
using Xunit;
|
||||
|
||||
public class AsciiHexDecodeFilterTests
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Filters
|
||||
namespace UglyToad.PdfPig.Tests.Filters
|
||||
{
|
||||
using System;
|
||||
using Parser.Parts;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Filters;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Filters;
|
||||
using Xunit;
|
||||
|
||||
public class DecodeParameterResolverTests
|
@@ -1,7 +1,7 @@
|
||||
namespace UglyToad.Pdf.Tests.Filters
|
||||
namespace UglyToad.PdfPig.Tests.Filters
|
||||
{
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Filters;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Filters;
|
||||
using Xunit;
|
||||
|
||||
public class RunLengthFilterTests
|
@@ -1,8 +1,8 @@
|
||||
// ReSharper disable ObjectCreationAsStatement
|
||||
namespace UglyToad.Pdf.Tests.Fonts.Cmap
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.Cmap
|
||||
{
|
||||
using System;
|
||||
using Pdf.Fonts.Cmap;
|
||||
using PdfPig.Fonts.Cmap;
|
||||
using Xunit;
|
||||
|
||||
public class CidRangeTests
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.Cmap
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.Cmap
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Pdf.Fonts.Cmap;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Fonts.Cmap;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class CodespaceRangeTests
|
@@ -1,8 +1,8 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.Encodings
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.Encodings
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using Pdf.Fonts.Encodings;
|
||||
using PdfPig.Fonts.Encodings;
|
||||
using Xunit;
|
||||
|
||||
public class GlyphListFactoryTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.Encodings
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.Encodings
|
||||
{
|
||||
using Pdf.Fonts.Encodings;
|
||||
using PdfPig.Fonts.Encodings;
|
||||
using Xunit;
|
||||
|
||||
public class GlyphListTests
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.Parser
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.Parser
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using IO;
|
||||
using Pdf.Fonts.Parser;
|
||||
using PdfPig.Fonts.Parser;
|
||||
using Xunit;
|
||||
|
||||
public class AdobeFontMetricsParserTests
|
||||
@@ -88,7 +88,7 @@ EndCharMetrics";
|
||||
[Fact]
|
||||
public void CanParseHelveticaAfmFile()
|
||||
{
|
||||
var helvetica = GetResourceBytes("UglyToad.Pdf.Resources.AdobeFontMetrics.Helvetica.afm");
|
||||
var helvetica = GetResourceBytes("UglyToad.PdfPig.Resources.AdobeFontMetrics.Helvetica.afm");
|
||||
|
||||
var input = new ByteArrayInputBytes(helvetica);
|
||||
|
@@ -1,10 +1,10 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.Parser
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.Parser
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using IO;
|
||||
using Pdf.Fonts.Parser;
|
||||
using PdfPig.Fonts.Parser;
|
||||
using Xunit;
|
||||
|
||||
public class CMapParserTests
|
||||
@@ -105,7 +105,7 @@ end";
|
||||
[Fact]
|
||||
public void CanParseIdentityHorizontalCMap()
|
||||
{
|
||||
var input = new ByteArrayInputBytes(ReadResourceBytes("UglyToad.Pdf.Resources.CMap.Identity-H"));
|
||||
var input = new ByteArrayInputBytes(ReadResourceBytes("UglyToad.PdfPig.Resources.CMap.Identity-H"));
|
||||
|
||||
var cmap = cMapParser.Parse(input, false);
|
||||
|
@@ -1,8 +1,8 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.Parser.Parts
|
||||
{
|
||||
using Pdf.Fonts.Cmap;
|
||||
using Pdf.Fonts.Parser.Parts;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Fonts.Cmap;
|
||||
using PdfPig.Fonts.Parser.Parts;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class BaseFontRangeParserTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts
|
||||
namespace UglyToad.PdfPig.Tests.Fonts
|
||||
{
|
||||
using Pdf.Fonts;
|
||||
using PdfPig.Fonts;
|
||||
using Xunit;
|
||||
|
||||
public class Standard14Tests
|
@@ -1,12 +1,12 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.TrueType.Parser
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.TrueType.Parser
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using IO;
|
||||
using Pdf.Fonts.TrueType;
|
||||
using Pdf.Fonts.TrueType.Parser;
|
||||
using Pdf.Fonts.TrueType.Tables;
|
||||
using PdfPig.Fonts.TrueType;
|
||||
using PdfPig.Fonts.TrueType.Parser;
|
||||
using PdfPig.Fonts.TrueType.Tables;
|
||||
using Xunit;
|
||||
|
||||
public class TrueTypeFontParserTests
|
@@ -1,7 +1,7 @@
|
||||
namespace UglyToad.Pdf.Tests.Fonts.TrueType
|
||||
namespace UglyToad.PdfPig.Tests.Fonts.TrueType
|
||||
{
|
||||
using IO;
|
||||
using Pdf.Fonts.TrueType;
|
||||
using PdfPig.Fonts.TrueType;
|
||||
using Xunit;
|
||||
|
||||
public class TrueTypeDataBytesTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Geometry
|
||||
namespace UglyToad.PdfPig.Tests.Geometry
|
||||
{
|
||||
using Pdf.Geometry;
|
||||
using PdfPig.Geometry;
|
||||
using Xunit;
|
||||
|
||||
public class PdfPointTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Geometry
|
||||
namespace UglyToad.PdfPig.Tests.Geometry
|
||||
{
|
||||
using Pdf.Geometry;
|
||||
using PdfPig.Geometry;
|
||||
using Xunit;
|
||||
|
||||
public class PdfVectorTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Graphics.Operations.General
|
||||
namespace UglyToad.PdfPig.Tests.Graphics.Operations.General
|
||||
{
|
||||
using Pdf.Graphics.Operations.General;
|
||||
using PdfPig.Graphics.Operations.General;
|
||||
using Xunit;
|
||||
|
||||
public class SetMiterLimitTests
|
@@ -1,8 +1,8 @@
|
||||
namespace UglyToad.Pdf.Tests.Graphics.Operations.SpecialGraphicsState
|
||||
namespace UglyToad.PdfPig.Tests.Graphics.Operations.SpecialGraphicsState
|
||||
{
|
||||
using System;
|
||||
using Pdf.Graphics;
|
||||
using Pdf.Graphics.Operations.SpecialGraphicsState;
|
||||
using PdfPig.Graphics;
|
||||
using PdfPig.Graphics.Operations.SpecialGraphicsState;
|
||||
using Xunit;
|
||||
|
||||
public class PopTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Graphics.Operations.SpecialGraphicsState
|
||||
namespace UglyToad.PdfPig.Tests.Graphics.Operations.SpecialGraphicsState
|
||||
{
|
||||
using Pdf.Graphics.Operations.SpecialGraphicsState;
|
||||
using PdfPig.Graphics.Operations.SpecialGraphicsState;
|
||||
using Xunit;
|
||||
|
||||
public class PushTests
|
@@ -1,8 +1,8 @@
|
||||
namespace UglyToad.Pdf.Tests.Graphics.Operations.TextState
|
||||
namespace UglyToad.PdfPig.Tests.Graphics.Operations.TextState
|
||||
{
|
||||
using System;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Graphics.Operations.TextState;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Graphics.Operations.TextState;
|
||||
using Xunit;
|
||||
|
||||
public class SetFontAndSizeTests
|
@@ -1,14 +1,13 @@
|
||||
namespace UglyToad.Pdf.Tests.Graphics
|
||||
namespace UglyToad.PdfPig.Tests.Graphics
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using Content;
|
||||
using ContentStream;
|
||||
using IO;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Fonts;
|
||||
using Pdf.Graphics;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Fonts;
|
||||
using PdfPig.Graphics;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
|
||||
internal class TestOperationContext : IOperationContext
|
||||
{
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using Xunit;
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
[Fact]
|
||||
public void Tests()
|
||||
{
|
||||
|
||||
//using (var document = PdfDocument.Open(@""))
|
||||
{
|
||||
//var page = document.GetPage(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -6,9 +6,9 @@
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Filters;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Filters;
|
||||
using Xunit;
|
||||
|
||||
/*
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
@@ -1,5 +1,5 @@
|
||||
// ReSharper disable AccessToDisposedClosure
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Integration
|
||||
namespace UglyToad.PdfPig.Tests.Integration
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
@@ -1,14 +1,14 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser
|
||||
namespace UglyToad.PdfPig.Tests.Parser
|
||||
{
|
||||
using Pdf.Cos;
|
||||
using Pdf.Graphics;
|
||||
using Pdf.Graphics.Core;
|
||||
using Pdf.Graphics.Operations.General;
|
||||
using Pdf.Graphics.Operations.TextObjects;
|
||||
using Pdf.Graphics.Operations.TextPositioning;
|
||||
using Pdf.Graphics.Operations.TextShowing;
|
||||
using Pdf.Graphics.Operations.TextState;
|
||||
using Pdf.Parser;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Graphics;
|
||||
using PdfPig.Graphics.Core;
|
||||
using PdfPig.Graphics.Operations.General;
|
||||
using PdfPig.Graphics.Operations.TextObjects;
|
||||
using PdfPig.Graphics.Operations.TextPositioning;
|
||||
using PdfPig.Graphics.Operations.TextShowing;
|
||||
using PdfPig.Graphics.Operations.TextState;
|
||||
using PdfPig.Parser;
|
||||
using Xunit;
|
||||
|
||||
public class PageContentParserTests
|
@@ -1,10 +1,10 @@
|
||||
// ReSharper disable ObjectCreationAsStatement
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts
|
||||
{
|
||||
using System;
|
||||
using IO;
|
||||
using Pdf.Parser.Parts;
|
||||
using Pdf.Util;
|
||||
using PdfPig.Parser.Parts;
|
||||
using PdfPig.Util;
|
||||
using Xunit;
|
||||
|
||||
public class BruteForceSearcherTests
|
@@ -1,12 +1,11 @@
|
||||
// ReSharper disable ObjectCreationAsStatement
|
||||
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts
|
||||
{
|
||||
using System;
|
||||
using Cos;
|
||||
using IO;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Parser.Parts;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Parser.Parts;
|
||||
using Xunit;
|
||||
|
||||
public class CosDictionaryParserTests
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts.CrossReference
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts.CrossReference
|
||||
{
|
||||
using System;
|
||||
using IO;
|
||||
using Pdf.Parser.Parts.CrossReference;
|
||||
using Pdf.Util;
|
||||
using PdfPig.Parser.Parts.CrossReference;
|
||||
using PdfPig.Util;
|
||||
using Xunit;
|
||||
|
||||
public class TableSubsectionDefinitionTests
|
@@ -1,9 +1,8 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts
|
||||
{
|
||||
using System;
|
||||
using Exceptions;
|
||||
using Pdf.Parser.FileStructure;
|
||||
using Pdf.Parser.Parts;
|
||||
using PdfPig.Parser.FileStructure;
|
||||
using Xunit;
|
||||
|
||||
public class FileHeaderParserTests
|
@@ -1,11 +1,11 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts.FileStructure
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts.FileStructure
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Exceptions;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Parser.FileStructure;
|
||||
using Pdf.Tokenization.Scanner;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Parser.FileStructure;
|
||||
using PdfPig.Tokenization.Scanner;
|
||||
using Xunit;
|
||||
|
||||
public class CrossReferenceTableParserTests
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts
|
||||
{
|
||||
using System;
|
||||
using Exceptions;
|
||||
using Pdf.Parser.FileStructure;
|
||||
using Pdf.Tokenization.Scanner;
|
||||
using PdfPig.Parser.FileStructure;
|
||||
using PdfPig.Tokenization.Scanner;
|
||||
using Xunit;
|
||||
|
||||
public class FileTrailerParserTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts
|
||||
{
|
||||
using Pdf.Parser.Parts;
|
||||
using PdfPig.Parser.Parts;
|
||||
using Xunit;
|
||||
|
||||
public class ReadHelperTests
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts
|
||||
{
|
||||
using System;
|
||||
using Logging;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests.Parser.Parts
|
||||
namespace UglyToad.PdfPig.Tests.Parser.Parts
|
||||
{
|
||||
using System;
|
||||
using IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Tests
|
||||
namespace UglyToad.PdfPig.Tests
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -25,16 +25,16 @@
|
||||
|
||||
var expected = new List<string>
|
||||
{
|
||||
"UglyToad.Pdf.PdfDocument",
|
||||
"UglyToad.Pdf.ParsingOptions",
|
||||
"UglyToad.Pdf.Logging.ILog",
|
||||
"UglyToad.Pdf.Geometry.PdfPoint",
|
||||
"UglyToad.Pdf.Fonts.Exceptions.InvalidFontFormatException",
|
||||
"UglyToad.Pdf.Exceptions.PdfDocumentFormatException",
|
||||
"UglyToad.Pdf.Content.Letter",
|
||||
"UglyToad.Pdf.Content.Page",
|
||||
"UglyToad.Pdf.Content.PageSize",
|
||||
"UglyToad.Pdf.Content.DocumentInformation"
|
||||
"UglyToad.PdfPig.PdfDocument",
|
||||
"UglyToad.PdfPig.ParsingOptions",
|
||||
"UglyToad.PdfPig.Logging.ILog",
|
||||
"UglyToad.PdfPig.Geometry.PdfPoint",
|
||||
"UglyToad.PdfPig.Fonts.Exceptions.InvalidFontFormatException",
|
||||
"UglyToad.PdfPig.Exceptions.PdfDocumentFormatException",
|
||||
"UglyToad.PdfPig.Content.Letter",
|
||||
"UglyToad.PdfPig.Content.Page",
|
||||
"UglyToad.PdfPig.Content.PageSize",
|
||||
"UglyToad.PdfPig.Content.DocumentInformation"
|
||||
};
|
||||
|
||||
Assert.Equal(expected.OrderBy(x => x), publicTypeNames.OrderBy(x => x));
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests
|
||||
namespace UglyToad.PdfPig.Tests
|
||||
{
|
||||
using System.Text;
|
||||
using IO;
|
||||
using Pdf.Tokenization.Scanner;
|
||||
using Pdf.Util;
|
||||
using PdfPig.Tokenization.Scanner;
|
||||
using PdfPig.Util;
|
||||
|
||||
internal static class StringBytesTestConverter
|
||||
{
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests
|
||||
namespace UglyToad.PdfPig.Tests
|
||||
{
|
||||
using IO;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Parser.Parts;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Parser.Parts;
|
||||
|
||||
internal class TestDictionaryParser : IDictionaryParser
|
||||
{
|
@@ -1,9 +1,9 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class ArrayTokenizerTests
|
@@ -1,7 +1,7 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class CommentTokenizerTests
|
@@ -1,12 +1,12 @@
|
||||
// ReSharper disable ParameterOnlyUsedForPreconditionCheck.Local
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Pdf.ContentStream;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class DictionaryTokenizerTests
|
@@ -1,7 +1,7 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class EndOfLineTokenizerTests
|
@@ -1,7 +1,7 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class HexTokenizerTests
|
@@ -1,7 +1,7 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class NameTokenizerTests
|
@@ -1,8 +1,8 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class NumericTokenizerTests
|
@@ -1,12 +1,12 @@
|
||||
// ReSharper disable ParameterOnlyUsedForPreconditionCheck.Local
|
||||
namespace UglyToad.Pdf.Tests.Tokenization.Scanner
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization.Scanner
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IO;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Tokenization.Scanner;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Tokenization.Scanner;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class CoreTokenScannerTests
|
@@ -1,8 +1,8 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization
|
||||
{
|
||||
using IO;
|
||||
using Pdf.Tokenization;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Tokenization;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class StringTokenizerTests
|
@@ -1,10 +1,10 @@
|
||||
// ReSharper disable ObjectCreationAsStatement
|
||||
namespace UglyToad.Pdf.Tests.Tokenization.Tokens
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization.Tokens
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Pdf.Cos;
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Cos;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class DictionaryTokenTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Tokenization.Tokens
|
||||
namespace UglyToad.PdfPig.Tests.Tokenization.Tokens
|
||||
{
|
||||
using Pdf.Tokenization.Tokens;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using Xunit;
|
||||
|
||||
public class HexTokenTests
|
@@ -73,7 +73,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UglyToad.Pdf\UglyToad.Pdf.csproj" />
|
||||
<ProjectReference Include="..\UglyToad.PdfPig\UglyToad.PdfPig.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
@@ -1,8 +1,7 @@
|
||||
using UglyToad.Pdf.Util;
|
||||
|
||||
namespace UglyToad.Pdf.Tests.Util
|
||||
namespace UglyToad.PdfPig.Tests.Util
|
||||
{
|
||||
using System;
|
||||
using PdfPig.Util;
|
||||
using Xunit;
|
||||
|
||||
public class InternalStringExtensionsTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Util
|
||||
namespace UglyToad.PdfPig.Tests.Util
|
||||
{
|
||||
using Pdf.Util;
|
||||
using PdfPig.Util;
|
||||
using Xunit;
|
||||
|
||||
public class OctalHelpersTests
|
@@ -1,6 +1,6 @@
|
||||
namespace UglyToad.Pdf.Tests.Util
|
||||
namespace UglyToad.PdfPig.Tests.Util
|
||||
{
|
||||
using Pdf.Util;
|
||||
using PdfPig.Util;
|
||||
using Xunit;
|
||||
|
||||
public class OtherEncodingsTests
|
@@ -1,11 +1,11 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26730.15
|
||||
VisualStudioVersion = 15.0.27130.2010
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UglyToad.Pdf", "UglyToad.Pdf\UglyToad.Pdf.csproj", "{57D0610C-87D3-4E0B-B7C2-EC8B765A8288}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UglyToad.PdfPig", "UglyToad.PdfPig\UglyToad.PdfPig.csproj", "{57D0610C-87D3-4E0B-B7C2-EC8B765A8288}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UglyToad.Pdf.Tests", "UglyToad.Pdf.Tests\UglyToad.Pdf.Tests.csproj", "{5BA09F66-5706-4637-B083-E1DC4D53289B}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UglyToad.PdfPig.Tests", "UglyToad.PdfPig.Tests\UglyToad.PdfPig.Tests.csproj", "{5BA09F66-5706-4637-B083-E1DC4D53289B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System;
|
||||
using ContentStream;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System;
|
||||
using Geometry;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System.Text;
|
||||
using Util.JetBrains.Annotations;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
internal class HeaderVersion
|
||||
{
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using ContentStream;
|
||||
using IO;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using ContentStream;
|
||||
using Cos;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using Geometry;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System;
|
||||
using Geometry;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using Graphics.Operations;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using Geometry;
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace UglyToad.Pdf.Content
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user