Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
13 changes: 13 additions & 0 deletions src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@

public class GithubIssuesTests
{
[Fact]
public void Issue736()
{
var doc = IntegrationHelpers.GetDocumentPath("Approved_Document_B__fire_safety__volume_2_-_Buildings_other_than_dwellings__2019_edition_incorporating_2020_and_2022_amendments.pdf");

using (var document = PdfDocument.Open(doc, new ParsingOptions() { UseLenientParsing = true, SkipMissingFonts = true }))
{
Assert.True(document.TryGetBookmarks(out var bookmarks));
Assert.Single(bookmarks.Roots);
Assert.Equal(36, bookmarks.Roots[0].Children.Count);
}
}

[Fact]
public void Issue693()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class ExplicitDestination
{
/// <summary>
/// The page number (1-based) of the destination.
/// <para>A value of <c>0</c> means no page destination was available (i.e. an invalid explicit destination).</para>
/// </summary>
public int PageNumber { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,19 @@ internal static bool TryGetExplicitDestination(
}
else
{
var errorMessage = $"{nameof(TryGetExplicitDestination)} No page number given in 'Dest': '{explicitDestinationArray}'.";
var errorMessage = $"{nameof(TryGetExplicitDestination)} No page number given in 'Dest': '{explicitDestinationArray}', defaulting to 0.";

log?.Error(errorMessage);

return false;
pageNumber = 0;
}

NameToken? destTypeToken = null;
if (explicitDestinationArray.Length > 1)
{
destTypeToken = explicitDestinationArray[1] as NameToken;
}

if (destTypeToken is null)
{
var errorMessage = $"Missing name token as second argument to explicit destination: {explicitDestinationArray}.";
Expand Down