Skip to content

Commit 4f92f09

Browse files
authored
Merge pull request #76 from synercoder/features/correct-newline-usage
Features/correct newline usage
2 parents fd8c3ac + ff5b10d commit 4f92f09

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
<RepositoryUrl>https://github.com/synercoder/FileFormats.Pdf/</RepositoryUrl>
3636
<RestoreSources>
3737
https://api.nuget.org/v3/index.json;
38-
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
3938
</RestoreSources>
4039
<UseSharedCompilation>true</UseSharedCompilation>
4140
</PropertyGroup>

src/Synercoding.FileFormats.Pdf/LowLevel/ObjectStream.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Synercoding.FileFormats.Pdf.LowLevel.Internal;
44
using Synercoding.FileFormats.Pdf.LowLevel.Text;
55
using Synercoding.FileFormats.Pdf.LowLevel.XRef;
6-
using System.IO.Compression;
76

87
namespace Synercoding.FileFormats.Pdf.LowLevel;
98

@@ -251,8 +250,7 @@ public ObjectStream Write(Separation separation)
251250
.Write(PdfName.Get("Range"), range);
252251
})
253252
.WriteByte(BRACKET_CLOSE)
254-
.EndObject()
255-
.NewLine();
253+
.EndObject();
256254

257255
return this;
258256
}
@@ -278,8 +276,7 @@ private void _indirectDictionary<T>(PdfReference reference, T data, Action<T, Pd
278276
InnerStream
279277
.StartObject(reference)
280278
.Dictionary(data, dictionaryAction)
281-
.EndObject()
282-
.NewLine();
279+
.EndObject();
283280
}
284281

285282
private void _indirectStream(PdfReference reference, Stream stream, params StreamFilter[] streamFilters)
@@ -311,13 +308,12 @@ private void _indirectStream<TData>(PdfReference reference, Stream stream, TData
311308

312309
dictionaryAction(data, dictionary);
313310
})
311+
.NewLine()
314312
.Write("stream")
315313
.NewLine()
316314
.CopyFrom(stream)
317315
.NewLine()
318316
.Write("endstream")
319-
.NewLine()
320-
.EndObject()
321-
.NewLine();
317+
.EndObject();
322318
}
323319
}

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>Fixed broken zlib stream by removing explicit header and replacing deflate with zlib.</PackageReleaseNotes>
13+
<PackageReleaseNotes>Added and removed newlines on byte level to better match the standard.</PackageReleaseNotes>
1414
</PropertyGroup>
1515

1616
</Project>

src/Synercoding.FileFormats.Pdf/PdfWriter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ private static void _writeTrailer(PdfStream stream, uint startXRef, int size, Pd
335335
.Write(PdfName.Get("Root"), root)
336336
.Write(PdfName.Get("Info"), documentInfo);
337337
})
338+
.NewLine()
338339
.Write("startxref")
339340
.NewLine()
340341
.Write(startXRef)

0 commit comments

Comments
 (0)