mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Compare commits
4 Commits
v0.1.12
...
release-ac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3174289a14 | ||
|
|
005e52783e | ||
|
|
f4e7db5b5b | ||
|
|
52ecef0e28 |
5
.github/workflows/publish_release.yml
vendored
5
.github/workflows/publish_release.yml
vendored
@@ -44,5 +44,10 @@ jobs:
|
||||
.\tools\set-version.ps1 $newVer -UpdateAssemblyAndFileVersion
|
||||
git config user.name "github-actions"
|
||||
git config user.email "github-actions@github.com"
|
||||
|
||||
git fetch origin master
|
||||
git checkout master
|
||||
git pull
|
||||
|
||||
git commit -am "Increment version to $newVer"
|
||||
git push
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net462;net471;net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Version>0.1.12</Version>
|
||||
<Version>0.1.13</Version>
|
||||
<IsTestProject>False</IsTestProject>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net462;net471;net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Version>0.1.12</Version>
|
||||
<Version>0.1.13</Version>
|
||||
<IsTestProject>False</IsTestProject>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net462;net471;net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Version>0.1.12</Version>
|
||||
<Version>0.1.13</Version>
|
||||
<IsTestProject>False</IsTestProject>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
|
||||
Binary file not shown.
@@ -6,9 +6,56 @@
|
||||
using PdfPig.Core;
|
||||
using PdfPig.Tokens;
|
||||
using SkiaSharp;
|
||||
using UglyToad.PdfPig.AcroForms;
|
||||
using UglyToad.PdfPig.AcroForms.Fields;
|
||||
|
||||
public class GithubIssuesTests
|
||||
{
|
||||
[Fact]
|
||||
public void Issue1208()
|
||||
{
|
||||
string[] files = ["Input.visible.pdf", "Input.invisible.pdf"];
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
var path = IntegrationHelpers.GetSpecificTestDocumentPath(file);
|
||||
|
||||
using (var document = PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true }))
|
||||
{
|
||||
Assert.True(document.TryGetForm(out AcroForm form));
|
||||
Assert.Single(form.Fields);
|
||||
Assert.Equal(AcroFieldType.Signature, form.Fields[0].FieldType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Issue1209()
|
||||
{
|
||||
var path = IntegrationHelpers.GetDocumentPath("MOZILLA-9176-2.pdf");
|
||||
|
||||
using (var document = PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true }))
|
||||
{
|
||||
for (int p = 1; p <= document.NumberOfPages; p++)
|
||||
{
|
||||
var page = document.GetPage(p);
|
||||
Assert.NotNull(page);
|
||||
|
||||
foreach (var image in page.GetImages())
|
||||
{
|
||||
Assert.True(image.ImageDictionary.ContainsKey(NameToken.Height)); // Was missing
|
||||
Assert.True(image.ImageDictionary.ContainsKey(NameToken.Width));
|
||||
|
||||
if (image.ImageDictionary.TryGet<DictionaryToken>(NameToken.DecodeParms, out var decodeParms))
|
||||
{
|
||||
Assert.True(decodeParms.ContainsKey(NameToken.Columns)); // Was missing
|
||||
Assert.True(decodeParms.ContainsKey(NameToken.Rows));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Revert_e11dc6b()
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net462;net471;net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Version>0.1.12</Version>
|
||||
<Version>0.1.13</Version>
|
||||
<IsTestProject>False</IsTestProject>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net462;net471;net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Version>0.1.12</Version>
|
||||
<Version>0.1.13</Version>
|
||||
<IsTestProject>False</IsTestProject>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
|
||||
@@ -61,6 +61,9 @@ internal static partial class FirstPassParser
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Code below commented to fix issue #1208, while not failing test Issue874
|
||||
* The logic would need to be reviewed before re-enabling.
|
||||
|
||||
// If we didn't brute force then use the previous position for ordering.
|
||||
foreach (var obj in streamsAndTables)
|
||||
{
|
||||
@@ -81,6 +84,11 @@ internal static partial class FirstPassParser
|
||||
orderedXrefs.Add(obj);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
orderedXrefs.AddRange(
|
||||
streamsAndTables
|
||||
.OrderBy(x => x.Offset));
|
||||
}
|
||||
|
||||
DictionaryToken? lastTrailer = null;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Core;
|
||||
using Filters;
|
||||
using Parser.Parts;
|
||||
@@ -156,6 +157,23 @@
|
||||
resolvedItems[NameToken.Create(kvp.Key)] = ResolveInternal(value, scanner, visited);
|
||||
}
|
||||
|
||||
if (resolvedItems.Count != dict.Data.Count)
|
||||
{
|
||||
if (resolvedItems.Count > dict.Data.Count)
|
||||
{
|
||||
throw new InvalidOperationException("Resolved more items than were present in the original dictionary. This should not be possible.");
|
||||
}
|
||||
|
||||
// We missed some due to cycles, try and resolve them now.
|
||||
foreach (var missing in dict.Data.Keys.Except(resolvedItems.Keys.Select(k => k.Data), StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
if (dict.Data[missing] is IndirectReferenceToken reference)
|
||||
{
|
||||
resolvedItems[NameToken.Create(missing)] = ResolveInternal(reference, scanner, visited);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new DictionaryToken(resolvedItems);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net462;net471;net6.0;net8.0;net9.0</TargetFrameworks>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Version>0.1.12</Version>
|
||||
<Version>0.1.13</Version>
|
||||
<IsTestProject>False</IsTestProject>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<PackageTags>PDF;Reader;Document;Adobe;PDFBox;PdfPig;pdf-extract;pdf-to-text;pdf;file;text;C#;dotnet;.NET</PackageTags>
|
||||
<RepositoryUrl>https://github.com/UglyToad/PdfPig</RepositoryUrl>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<Version>0.1.12</Version>
|
||||
<AssemblyVersion>0.1.12.0</AssemblyVersion>
|
||||
<FileVersion>0.1.12.0</FileVersion>
|
||||
<Version>0.1.13</Version>
|
||||
<AssemblyVersion>0.1.13.0</AssemblyVersion>
|
||||
<FileVersion>0.1.13.0</FileVersion>
|
||||
<PackageIconUrl>https://raw.githubusercontent.com/UglyToad/PdfPig/master/documentation/pdfpig.png</PackageIconUrl>
|
||||
<PackageIcon>pdfpig.png</PackageIcon>
|
||||
<Product>PdfPig</Product>
|
||||
|
||||
Reference in New Issue
Block a user