Skip to content

Features/correct newline usage #75

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<RepositoryUrl>https://github.com/synercoder/FileFormats.Pdf/</RepositoryUrl>
<RestoreSources>
https://api.nuget.org/v3/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
</RestoreSources>
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>
Expand Down
12 changes: 4 additions & 8 deletions src/Synercoding.FileFormats.Pdf/LowLevel/ObjectStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Synercoding.FileFormats.Pdf.LowLevel.Internal;
using Synercoding.FileFormats.Pdf.LowLevel.Text;
using Synercoding.FileFormats.Pdf.LowLevel.XRef;
using System.IO.Compression;

namespace Synercoding.FileFormats.Pdf.LowLevel;

Expand Down Expand Up @@ -251,8 +250,7 @@ public ObjectStream Write(Separation separation)
.Write(PdfName.Get("Range"), range);
})
.WriteByte(BRACKET_CLOSE)
.EndObject()
.NewLine();
.EndObject();

return this;
}
Expand All @@ -278,8 +276,7 @@ private void _indirectDictionary<T>(PdfReference reference, T data, Action<T, Pd
InnerStream
.StartObject(reference)
.Dictionary(data, dictionaryAction)
.EndObject()
.NewLine();
.EndObject();
}

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

dictionaryAction(data, dictionary);
})
.NewLine()
.Write("stream")
.NewLine()
.CopyFrom(stream)
.NewLine()
.Write("endstream")
.NewLine()
.EndObject()
.NewLine();
.EndObject();
}
}
2 changes: 1 addition & 1 deletion src/Synercoding.FileFormats.Pdf/PackageDetails.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Product>Synercoding.FileFormats.Pdf</Product>
<Title>Synercoding.FileFormats.Pdf</Title>
<Description>Contains classes which makes it easy to quickly create a pdf file.</Description>
<PackageReleaseNotes>Fixed broken zlib stream by removing explicit header and replacing deflate with zlib.</PackageReleaseNotes>
<PackageReleaseNotes>Added and removed newlines on byte level to better match the standard.</PackageReleaseNotes>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions src/Synercoding.FileFormats.Pdf/PdfWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ private static void _writeTrailer(PdfStream stream, uint startXRef, int size, Pd
.Write(PdfName.Get("Root"), root)
.Write(PdfName.Get("Info"), documentInfo);
})
.NewLine()
.Write("startxref")
.NewLine()
.Write(startXRef)
Expand Down