mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
namespace UglyToad.PdfPig.Tests.Integration
|
|
{
|
|
using UglyToad.PdfPig.Core;
|
|
using Xunit;
|
|
|
|
public class XObjectFormTests
|
|
{
|
|
[Fact]
|
|
public void CanReadDocumentWithoutStackOverflowIssue671()
|
|
{
|
|
using (var document = PdfDocument.Open(IntegrationHelpers.GetDocumentPath("issue_671")))
|
|
{
|
|
var page = document.GetPage(1);
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void CanReadDocumentThrowsIssue671()
|
|
{
|
|
using (var document = PdfDocument.Open(IntegrationHelpers.GetDocumentPath("issue_671"), ParsingOptions.LenientParsingOff))
|
|
{
|
|
var exception = Assert.Throws<PdfDocumentFormatException>(() => document.GetPage(1));
|
|
Assert.Contains("is referencing itself which can cause unexpected behaviour", exception.Message);
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void CanReadDocumentMOZILLA_3136_0()
|
|
{
|
|
// This document does not actually contain circular references
|
|
using (var document = PdfDocument.Open(IntegrationHelpers.GetDocumentPath("MOZILLA-3136-0"), ParsingOptions.LenientParsingOff))
|
|
{
|
|
var page = document.GetPage(1);
|
|
}
|
|
}
|
|
}
|
|
}
|