-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add path-based SVG rendering with RLE encoding to reduce file size and memory usage #655
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
Changes from 13 commits
e8b7054
5be3566
96159c8
c640bec
1e363d7
333d04f
17a05f3
e665c56
3f6dd5b
b2c8d19
8ad2c67
b2b37b4
e87b31c
58789f5
790d32f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -204,11 +204,11 @@ private string CreatePathFromModules() | |
|
|
||
| // Create a single rectangle for the entire run of dark modules | ||
| // Format: x y width height re | ||
| pathCommands.Append(ToStr(startX)); | ||
| pathCommands.AppendInvariant(startX); | ||
| pathCommands.Append(' '); | ||
| pathCommands.Append(ToStr(y)); | ||
| pathCommands.AppendInvariant(y); | ||
| pathCommands.Append(' '); | ||
| pathCommands.Append(ToStr(x - startX)); | ||
| pathCommands.AppendInvariant(x - startX); | ||
| pathCommands.Append(" 1 re\r\n"); | ||
|
Comment on lines
205
to
212
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hopefully for v2 this can all be cleaned up into an interpolated string, fully optimized for .NET Standard 2.1+, but compatible with .NET Standard 2.0 as well. |
||
| } | ||
| } | ||
|
|
@@ -242,10 +242,10 @@ private static string ColorToPdfRgb(byte[] color) | |
| private static string ToStr(int value) => value.ToString(CultureInfo.InvariantCulture); | ||
|
|
||
| /// <summary> | ||
| /// Converts an integer to a string using invariant culture for consistent PDF formatting. | ||
| /// Converts a float to a string using invariant culture for consistent PDF formatting. | ||
| /// </summary> | ||
| /// <param name="value">The integer value to convert.</param> | ||
| /// <returns>String representation of the integer.</returns> | ||
| /// <param name="value">The float value to convert.</param> | ||
| /// <returns>String representation of the float.</returns> | ||
| private static string ToStr(float value) => value.ToString("0.######", CultureInfo.InvariantCulture); | ||
| } | ||
|
|
||
|
|
||
Large diffs are not rendered by default.
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well this savings are impressive 👍🏻 |
Uh oh!
There was an error while loading. Please reload this page.