Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow /Filter value to be a indirect object. #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions src/PdfSharp/Pdf.Filters/Filtering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
// DEALINGS IN THE SOFTWARE.
#endregion

using PdfSharp.Pdf.Advanced;
using System;
using System.Diagnostics;

Expand Down Expand Up @@ -201,6 +202,12 @@ public static byte[] Decode(byte[] data, string filterName)
public static byte[] Decode(byte[] data, PdfItem filterItem)
{
byte[] result = null;
if (filterItem is PdfReference)
{
PdfReference iref = (PdfReference)filterItem;
Debug.Assert(iref.Value != null, "Indirect /Filter value is null");
filterItem = iref.Value;
}
if (filterItem is PdfName)
{
Filter filter = GetFilter(filterItem.ToString());
Expand Down