mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
Default page number to 0 in ExplicitDestination when the Dest has no page number and fix #736
Some checks failed
Build and test / build (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled
Nightly Release / tests (push) Has been cancelled
Nightly Release / Check latest commit (push) Has been cancelled
Nightly Release / build_and_publish_nightly (push) Has been cancelled
Some checks failed
Build and test / build (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled
Nightly Release / tests (push) Has been cancelled
Nightly Release / Check latest commit (push) Has been cancelled
Nightly Release / build_and_publish_nightly (push) Has been cancelled
This commit is contained in:
parent
e10609e4e1
commit
40af401364
Binary file not shown.
@ -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()
|
||||
{
|
||||
|
@ -7,6 +7,7 @@
|
||||
{
|
||||
/// <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; }
|
||||
|
||||
|
@ -136,11 +136,11 @@
|
||||
}
|
||||
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;
|
||||
@ -148,6 +148,7 @@
|
||||
{
|
||||
destTypeToken = explicitDestinationArray[1] as NameToken;
|
||||
}
|
||||
|
||||
if (destTypeToken is null)
|
||||
{
|
||||
var errorMessage = $"Missing name token as second argument to explicit destination: {explicitDestinationArray}.";
|
||||
|
Loading…
Reference in New Issue
Block a user