Skip to content

Commit 454f873

Browse files
committed
Replace deflate with zlibstream
1 parent 03a8769 commit 454f873

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Synercoding.FileFormats.Pdf/PackageDetails.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Product>Synercoding.FileFormats.Pdf</Product>
1111
<Title>Synercoding.FileFormats.Pdf</Title>
1212
<Description>Contains classes which makes it easy to quickly create a pdf file.</Description>
13-
<PackageReleaseNotes>Added transparent and separation images support. Content streams will be flatedecode encoded. And overprint mode support is added.</PackageReleaseNotes>
13+
<PackageReleaseNotes>Fixed broken zlib stream by removing explicit header and replacing deflate with zlib.</PackageReleaseNotes>
1414
</PropertyGroup>
1515

1616
</Project>

src/Synercoding.FileFormats.Pdf/PdfWriter.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,10 @@ internal static Stream FlateEncode(Stream inputStream)
275275
{
276276
var outputStream = new MemoryStream();
277277

278-
outputStream.WriteByte(0x78);
279-
outputStream.WriteByte(0xDA);
280-
281278
inputStream.Position = 0;
282-
using (var flateStream = new DeflateStream(outputStream, CompressionLevel.SmallestSize, true))
279+
using (var zlibStream = new ZLibStream(outputStream, CompressionLevel.SmallestSize, true))
283280
{
284-
inputStream.CopyTo(flateStream);
281+
inputStream.CopyTo(zlibStream);
285282
}
286283

287284
outputStream.Position = 0;

0 commit comments

Comments
 (0)