PdfPig.Filters.Dct.JpegLibrary 0.1.12.1
UglyToad.PdfPig.Filters.Dct.JpegLibrary
PdfPig implementation of the DCT (Jpeg) filter, based on JpegLibrary (MIT License - See LICENCE and THIRD-PARTY-NOTICES)
Other filters
- JPX filter available here: https://github.com/BobLd/UglyToad.PdfPig.Filters.Jpx.OpenJpegDotNet
- JBIG2 filter available here: https://github.com/BobLd/UglyToad.PdfPig.Filters.Jbig2.PdfboxJbig2
Usage
// Create your filter provider
public sealed class MyFilterProvider : BaseFilterProvider
{
/// <summary>
/// The single instance of this provider.
/// </summary>
public static readonly IFilterProvider Instance = new MyFilterProvider();
/// <inheritdoc/>
private MyFilterProvider() : base(GetDictionary())
{
}
private static Dictionary<string, IFilter> GetDictionary()
{
var ascii85 = new Ascii85Filter();
var asciiHex = new AsciiHexDecodeFilter();
var ccitt = new CcittFaxDecodeFilter();
var dct = new JpegLibraryDctDecodeFilter(); // new filter
var flate = new FlateFilter();
var jbig2 = new Jbig2DecodeFilter();
var jpx = new JpxDecodeFilter();
var runLength = new RunLengthFilter();
var lzw = new LzwFilter();
return new Dictionary<string, IFilter>
{
{ NameToken.Ascii85Decode.Data, ascii85 },
{ NameToken.Ascii85DecodeAbbreviation.Data, ascii85 },
{ NameToken.AsciiHexDecode.Data, asciiHex },
{ NameToken.AsciiHexDecodeAbbreviation.Data, asciiHex },
{ NameToken.CcittfaxDecode.Data, ccitt },
{ NameToken.CcittfaxDecodeAbbreviation.Data, ccitt },
{ NameToken.DctDecode.Data, dct }, // new filter
{ NameToken.DctDecodeAbbreviation.Data, dct }, // new filter
{ NameToken.FlateDecode.Data, flate },
{ NameToken.FlateDecodeAbbreviation.Data, flate },
{ NameToken.Jbig2Decode.Data, jbig2 },
{ NameToken.JpxDecode.Data, jpx },
{ NameToken.RunLengthDecode.Data, runLength },
{ NameToken.RunLengthDecodeAbbreviation.Data, runLength },
{ NameToken.LzwDecode.Data, lzw },
{ NameToken.LzwDecodeAbbreviation.Data, lzw }
};
}
}
var parsingOption = new ParsingOptions()
{
UseLenientParsing = true,
SkipMissingFonts = true,
FilterProvider = MyFilterProvider.Instance
};
using (var doc = PdfDocument.Open("test.pdf", parsingOption))
{
int i = 0;
foreach (var page in doc.GetPages())
{
foreach (var pdfImage in page.GetImages())
{
Assert.True(pdfImage.TryGetPng(out var bytes));
File.WriteAllBytes($"image_{i++}.png", bytes);
}
}
}
Showing the top 20 packages that depend on PdfPig.Filters.Dct.JpegLibrary.
| Packages | Downloads |
|---|---|
|
PdfPig.Rendering.Skia
Render pdf documents as images using PdfPig and SkiaSharp.
|
1 |
.NET Framework 4.6.2
- PdfPig (>= 0.1.12)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
- System.Memory (>= 4.6.0)
.NET Standard 2.0
- System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
- System.Memory (>= 4.6.0)
- PdfPig (>= 0.1.12)
.NET 8.0
- PdfPig (>= 0.1.12)
.NET 6.0
- PdfPig (>= 0.1.12)
.NET Framework 4.7.1
- System.Memory (>= 4.6.0)
- PdfPig (>= 0.1.12)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
| Version | Downloads | Last updated |
|---|---|---|
| 0.1.12.1 | 1 | 11/16/2025 |
| 0.1.11 | 0 | 07/27/2025 |
| 0.1.11-alpha001 | 0 | 05/30/2025 |
| 0.1.10.2 | 0 | 03/15/2025 |
| 0.1.10.1 | 0 | 03/08/2025 |
| 0.1.10.1-alpha003 | 0 | 02/23/2025 |
| 0.1.10.1-alpha002 | 0 | 02/22/2025 |
| 0.1.10.1-alpha001 | 0 | 10/18/2024 |