Closed johnHastings772 closed 1 year ago
Hi! Thank you for your interest in VectSharp!
I will start by saying that your approach seems to be overly complicated to me - if you're using VectSharp, you don't need to have a template SVG file, and you can easily draw everything directly in C# (at least, it will be easier than getting the SVG to be parsed correctly).
For example:
using VectSharp;
using VectSharp.PDF;
using VectSharp.Raster;
// Create a SimpleFontLibrary and add the Arial fonts to it.
// I would strongly recommend using Helvetica or shipping your
// own font files instead of relying on system fonts, though!
SimpleFontLibrary fontLibrary = new SimpleFontLibrary();
fontLibrary.Add(@"C:\\Windows\\Fonts\\arialbd.ttf");
fontLibrary.Add(@"C:\\Windows\\Fonts\\arialbi.ttf");
fontLibrary.Add(@"C:\\Windows\\Fonts\\arial.ttf");
FontFamily.DefaultFontLibrary = fontLibrary;
// Create the fonts.
Font arialRegular = new Font(FontFamily.ResolveFontFamily("Arial"), 20);
Font arialBold = new Font(FontFamily.ResolveFontFamily("Arial Bold"), 20);
Font arialBoldItalic = new Font(FontFamily.ResolveFontFamily("Arial Bold Italic"), 20);
// Strings that will be drawn on the page.
string stringBold = "Arial bold text";
string stringBoldItalic = "Arial Italic bold text";
string stringRegularClipped = "Arial regular text with clipping path and overflow";
// Raster image.
RasterImageFile image = new RasterImageFile(@"icon.png");
// Page size in dots - note the conversion factor.
double pageWidth = 210 * 72 / 25.4;
double pageHeight = 297 * 72 / 25.4;
// Create the Page.
Page pag = new Page(pageWidth, pageHeight);
// Obtain the Graphics object on which to draw.
Graphics gpr = pag.Graphics;
// Draw the right-aligned text. Use the TextBaseline.Baseline to make sure that
// the strings drawn on the same line are properly aligned vertically.
gpr.FillText(260 - arialBold.MeasureText(stringBold).Width, 120, stringBold, arialBold, Colours.Black, TextBaselines.Baseline);
// Draw the "/".
gpr.FillText(270 - arialRegular.MeasureText("/").Width * 0.5, 120, "/", arialRegular, Colours.Black, TextBaselines.Baseline);
// Draw the left-aligned bold italic text.
gpr.FillText(280, 120, stringBoldItalic, arialBoldItalic, Colours.Black, TextBaselines.Baseline);
// Save the graphics state (need this to revert the clipping path).
gpr.Save();
// Set the clipping path.
gpr.SetClippingPath(125, 145, 305, 30);
// Draw the clipped text.
gpr.FillText(125, 150, stringRegularClipped, arialRegular, Colours.Black);
// Restore the graphics state (thereby removing the clipping path).
gpr.Restore();
// Draw the raster image.
gpr.DrawRasterImage(pageWidth * 0.5 - 175, pageHeight * 0.5 - 175, 350, 350, image);
// Create the document.
Document doc = new Document();
// Add the page to the document.
doc.Pages.Add(pag);
// Save the PDF (no need to specify compressStreams: true, it is the default).
doc.SaveAsPDF("poc.pdf");
That said, regarding the issues you see when parsing the SVG file:
VectSharp.SVG.Parser.ParseImageURI = VectSharp.MuPDFUtils.ImageURIParser.Parser(VectSharp.SVG.Parser.ParseSVGURI);
(replace MuPDFUtils
with ImageSharpUtils
, if necessary).
font-weight: bold
attribute set only in the outer text
element, and not in the tspan
. Adding this attribute to the tspan
makes the font bold (though still not Arial, see below).rect
and not as a path
. Specifying it as a path
makes it work.For the page size, you're indeed missing a conversion. The SVG object is parsed into a page that with size 210x297 dots. For a PDF document, each dot is 1/72nd of an inch. Therefore, to get a PDF page that with size 210x297 mm, you need to scale everything by a factor of 72 / 25.4 ≈ 2.8346
[ (dots / inch) / (mm / inch) = dots / mm]:
var vectSharpPage = Parser.FromStream(svgDocMs);
double scalingFactor = 72 / 25.4;
Page scaledPage = new Page(vectSharpPage.Width * scalingFactor, vectSharpPage.Height * scalingFactor);
scaledPage.Graphics.Scale(scalingFactor, scalingFactor);
scaledPage.Graphics.DrawGraphics(0, 0, vectSharpPage.Graphics);
VSPdf.Pages.Add(scaledPage);
Note that the SVG parsing functions of VectSharp.SVG are mainly intended to deal with SVG files produced by VectSharp itself... The SVG standard is huge (not even Inkscape implements everything)!
I am attaching:
The modified C# code to create the PDF:
// Set up the raster image parser
VectSharp.SVG.Parser.ParseImageURI = VectSharp.MuPDFUtils.ImageURIParser.Parser(VectSharp.SVG.Parser.ParseSVGURI);
var svgDoc = XDocument.Load("POC.svg");
svgDoc.Root!.Elements().Elements()
.Where(x => x.Attribute("id")!.Value.ToString() == "ArialRegularSpan")
.FirstOrDefault()!.SetValue("Arial regular text with clipping path and overflow");
var svgDocMs = new MemoryStream();
var VSPdf = new Document();
svgDoc.Save(svgDocMs, SaveOptions.DisableFormatting);
svgDocMs.Position = 0;
// Parse the SVG file
var vectSharpPage = Parser.FromStream(svgDocMs);
// Scaling factor from mm to dots
double scalingFactor = 72 / 25.4;
// Scale the page
Page scaledPage = new Page(vectSharpPage.Width * scalingFactor, vectSharpPage.Height * scalingFactor);
scaledPage.Graphics.Scale(scalingFactor, scalingFactor);
scaledPage.Graphics.DrawGraphics(0, 0, vectSharpPage.Graphics);
// Add the scaled page to the document
VSPdf.Pages.Add(scaledPage);
VSPdf.SaveAsPDF("vectSharpPOC.pdf", compressStreams: true);
vectSharpPOC.pdf
file that is producedGreetings and thanks for the feedback!
I've been able to solve most of the issues I had with your guidance, let me tell you a bit more about the document I'm trying to create:
it's something similar to a legal text that can/may change within short periods of time. A non technical user is required to make changes to the template. There's a format model that must be matched with accuracy. Some of it's pages are optional and some fields are optional too. There's some anti-adobe sentiment in between (so no adobe authoring tools are allowed, publishing to pdf is fine though).
On the plus side using an SVG template reduces code and allows to track changes easily on git.
Adding ParseImageURI was easy, I've been testing too the rect to path clipping changes and see no problems with the result file, the scaling is just 3 lines of code (although I'd rather avoid it if possible) and I'm starting to make changes on the text but with the current implementation of the SVG parser seems like it's impossible to use any other font than embedded ones.
Would you consider having a Font Library as an optional parameter to the SVG parser? (In case that helps in getting the fonts from external sources. I don't know much about the innards of VectSharp)
I don't know if it would increase the complexity of the code considerably so I wonder if I'm asking for too much here. I need to check the VectSharp code further in case I'm missing some other way to have the font and still keep using the SVG template without embedded fonts.
Thanks for your help and attention!
Hi again, good news!
It turns out implementing the fix was easier than I expected 😉
I have just pushed to NuGet VectSharp.SVG version 1.8.2-a2 (it may take a few minutes to appear). If you install this, you only need to add the following lines somewhere before parsing the SVG document:
SimpleFontLibrary fontLibrary = new SimpleFontLibrary();
fontLibrary.Add(@"C:\Windows\Fonts\arialbd.ttf"); // Arial Bold
fontLibrary.Add(@"C:\Windows\Fonts\arialbi.ttf"); // Arial Bold Italic
fontLibrary.Add(@"C:\Windows\Fonts\arial.ttf"); // Arial Regular - ALWAYS load the regular font last!
FontFamily.DefaultFontLibrary = fontLibrary;
This will allow the SVG parser to load the Arial fonts when it finds them in the SVG file. Of course, you will need to add the Italic version too, if you're using that (it shouldn't hurt to add it even if you are not using it now - maybe you will need it in the future).
This is not limited to Arial, of course; you can use any font, but just make sure that you add the "regular" font style last. Actually, I would strongly recommend you distribute to the user whatever font files you need to be using (assuming that the licence allows it), so that you don't have to make any assumptions about their system.
As a bonus, I also fixed the issue where font styles were not propagated from the parent <text>
element to the child <tspan>
elements (item 2 in my previous reply), and clipping paths defined as <rect>
objects now work too (item 3). It seems I was wrong about item 6 - text alignments already work correctly.
Therefore, I believe that with the ParseImageURI
line and the above lines to load the fonts, you should be able to parse the original file you sent me correctly.
Please try this new version, and if everything works fine, I'll mark it as stable and update the docs!
Thanks you very much for all the effort the results are really really good!
My document now renders almost perfecly, there's only one minor issue:
There seems to be some problem with with this new version of VectSharp.SVG regarding kerning and/or alignment of the character '1' (might happen too with other characters but with '1' it's really evident).
Also, some improvements that would nice to have in order to reduce lines of code on my template rendering implementation could be:
1) Have the option to create a default font library from system fonts or specific font directory( similar as iText), that way the user could change the font in the template and I wouln't need to change a single line of code.
2) Apply the needed scaling on the parser, in my SVG file the units are specified as milimeters it seems the VectSharp.SVG parser takes the value but ignores the unit interpreting it as points.
As before I don't know if I'm asking for too much here, those are just a couple of improvements that would make using VectSharp even easier.
Here's a Proof of concept code to illustrate on the problem with font alignment of '1':
using System.Xml.Linq;
using VectSharp;
using VectSharp.SVG;
using VectSharp.PDF;
using iText.Kernel.Pdf;
using iText.Layout.Font;
using iText.Svg.Converter;
using iText.Svg.Processors.Impl;
var svgPOCXDocuemnt = XDocument.Load("POC2.svg");
var svgPOCXDocuemntMs = new MemoryStream();
VectSharp.SVG.Parser.ParseImageURI = VectSharp.ImageSharpUtils.ImageURIParser.Parser(VectSharp.SVG.Parser.ParseSVGURI);
var vectSharpPdf = new Document();
svgPOCXDocuemnt.Save(svgPOCXDocuemntMs, SaveOptions.DisableFormatting);
svgPOCXDocuemntMs.Position = 0;
SimpleFontLibrary fontLibrary = new SimpleFontLibrary();
var fontPath = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
fontLibrary.Add(Path.Join(fontPath, "arialbd.ttf")); // Arial Bold
fontLibrary.Add(Path.Join(fontPath, "ariali.ttf")); // Arial Italic
fontLibrary.Add(Path.Join(fontPath, "arialbi.ttf")); // Arial Bold Italic
fontLibrary.Add(Path.Join(fontPath, "arial.ttf")); // Arial Regular - ALWAYS load the regular font last!
FontFamily.DefaultFontLibrary = fontLibrary;
var vectSharpPage = Parser.FromStream(svgPOCXDocuemntMs);
double scalingFactor = 72 / 25.4;
var scaledvectSharpPage = new Page(vectSharpPage.Width * scalingFactor, vectSharpPage.Height * scalingFactor);
scaledvectSharpPage.Graphics.Scale(scalingFactor, scalingFactor);
scaledvectSharpPage.Graphics.DrawGraphics(0, 0, vectSharpPage.Graphics);
vectSharpPdf.Pages.Add(scaledvectSharpPage);
vectSharpPdf.Pages.Add(vectSharpPage);
vectSharpPdf.SaveAsPDF("vectSharpPOC.pdf", compressStreams: true);
var iTextPdf = new PdfDocument(new PdfWriter("itextPOC.pdf", new WriterProperties().SetCompressionLevel(CompressionConstants.BEST_COMPRESSION)));
var properties = new SvgConverterProperties();
FontProvider provider = new FontProvider();
provider.AddSystemFonts();
properties.SetFontProvider(provider);
iTextPdf.AddNewPage();
svgPOCXDocuemntMs = new MemoryStream();
svgPOCXDocuemnt.Save(svgPOCXDocuemntMs, SaveOptions.DisableFormatting);
svgPOCXDocuemntMs.Position = 0;
SvgConverter.DrawOnDocument(svgPOCXDocuemntMs, iTextPdf, 1, properties);
iTextPdf.Close();
Here's the new SVG file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg5"
xml:space="preserve"
xmlns="http://www.w3.org/2000/svg">
<defs
id="defs2">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31891">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31893"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31887">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31889"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31883">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31885"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31879">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31881"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31875">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31877"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31871">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31873"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31867">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31869"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31863">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31865"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31859">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31861"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31855">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31857"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31851">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31853"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31847">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31849"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31843">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31845"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31839">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31841"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31835">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31837"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31831">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31833"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31827">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31829"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31823">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31825"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31819">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31821"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31815">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31817"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31811">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31813"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31807">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31809"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31803">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31805"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31799">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31801"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31795">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31797"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31791">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31793"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31787">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31789"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31783">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31785"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31779">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31781"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31775">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31777"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31771">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31773"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31767">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31769"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath31703">
<rect
style="fill:#00ff00;stroke-width:0.588809;stop-color:#000000"
id="rect31705"
width="10.251294"
height="159.90102"
x="14.945811"
y="120.04552" />
</clipPath>
</defs>
<g
id="layer1">
<path
d="m 98.300279,82.224296 h 62.456281 v -41.9239 H 98.300279 Z"
style="fill:none;stroke:#231f20;stroke-width:1.71475;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path617" /><path
d="M 98.300281,137.26534 H 160.75656 V 95.34144 H 98.300281 Z"
style="fill:none;stroke:#231f20;stroke-width:1.71475;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path623" /><path
d="m 98.30028,188.79705 h 62.45628 v -41.9239 H 98.30028 Z"
style="fill:none;stroke:#231f20;stroke-width:1.71475;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26377" />
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="189.17186"
y="22.57243"
id="text621"
clip-path="none"
transform="matrix(4.860706,0,0,4.860706,-789.46796,-43.525681)"><tspan
id="tspan619"
x="189.17186"
y="22.57243"
style="stroke-width:0.264583">1</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="189.17186"
y="22.57243"
id="text627"
clip-path="none"
transform="matrix(4.860706,0,0,4.860706,-789.82578,11.515363)"><tspan
id="tspan625"
x="189.17186"
y="22.57243"
style="stroke-width:0.264583">2</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="189.17186"
y="22.57243"
id="Page1Text"
clip-path="none"
transform="matrix(4.860706,0,0,4.860706,-789.95693,62.959996)"><tspan
id="Page1"
x="189.17186"
y="22.57243"
style="stroke-width:0.264583">3</tspan></text>
<path
d="m 16.122185,124.25007 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path25981"
clip-path="url(#clipPath31891)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,129.25006 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path25985"
clip-path="url(#clipPath31887)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,134.25009 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path25989"
clip-path="url(#clipPath31883)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,139.25007 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path25993"
clip-path="url(#clipPath31879)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,144.25007 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path25997"
clip-path="url(#clipPath31875)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,149.25009 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26001"
clip-path="url(#clipPath31871)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,154.25008 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26005"
clip-path="url(#clipPath31867)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,159.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26009"
clip-path="url(#clipPath31863)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,164.2501 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26013"
clip-path="url(#clipPath31859)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,169.25008 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26017"
clip-path="url(#clipPath31855)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,174.25008 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26021"
clip-path="url(#clipPath31851)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,179.2501 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26025"
clip-path="url(#clipPath31847)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,184.25009 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26029"
clip-path="url(#clipPath31843)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,189.25008 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26033"
clip-path="url(#clipPath31839)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,194.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26037"
clip-path="url(#clipPath31835)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,199.2501 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26041"
clip-path="url(#clipPath31831)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,204.25008 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26045"
clip-path="url(#clipPath31827)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,209.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26049"
clip-path="url(#clipPath31823)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,214.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26053"
clip-path="url(#clipPath31819)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,219.25013 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26057"
clip-path="url(#clipPath31815)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,224.25012 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26061"
clip-path="url(#clipPath31811)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,229.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26065"
clip-path="url(#clipPath31807)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,234.2501 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26069"
clip-path="url(#clipPath31803)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,239.25012 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26073"
clip-path="url(#clipPath31799)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,244.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26077"
clip-path="url(#clipPath31795)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,249.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26081"
clip-path="url(#clipPath31791)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,254.25013 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26085"
clip-path="url(#clipPath31787)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,259.25012 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26089"
clip-path="url(#clipPath31783)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,264.25011 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26093"
clip-path="url(#clipPath31779)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,269.25013 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26097"
clip-path="url(#clipPath31775)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="m 16.122185,274.25012 h 7.87788"
style="fill:none;stroke:#231f20;stroke-width:0.0881944;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26101"
clip-path="url(#clipPath31771)"
transform="matrix(1.7535341,0,0,1.7535341,7.6074121,-202.32325)" />
<path
d="M 35.878213,287.35141 H 49.692344"
style="fill:none;stroke:#231f20;stroke-width:0.154652;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path26105" />
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="122.67604"
id="Ord1Text"
clip-path="url(#clipPath31767)"
transform="matrix(1.7535341,0,0,1.7535341,7.7934778,-202.32325)"><tspan
id="Ord1"
x="20.060436"
y="122.67604"
style="stroke-width:0.264583">1</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="127.67708"
id="Ord2Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6643914,-202.32325)"><tspan
id="Ord2"
x="20.060436"
y="127.67708"
style="stroke-width:0.264583">2</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="132.67812"
id="Ord3Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6170774,-202.32325)"><tspan
id="Ord3"
x="20.060436"
y="132.67812"
style="stroke-width:0.264583">3</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="137.67915"
id="Ord4Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.69682,-202.32325)"><tspan
id="Ord4"
x="20.060436"
y="137.67915"
style="stroke-width:0.264583">4</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="142.68019"
id="Ord5Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6049952,-202.32325)"><tspan
id="Ord5"
x="20.060436"
y="142.68019"
style="stroke-width:0.264583">5</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="147.68123"
id="Ord6Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6291596,-202.32325)"><tspan
id="Ord6"
x="20.060436"
y="147.68123"
style="stroke-width:0.264583">6</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="152.68227"
id="Ord7Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.603787,-202.32325)"><tspan
id="Ord7"
x="20.060436"
y="152.68227"
style="stroke-width:0.264583">7</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="157.6833"
id="Ord8Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6170774,-202.32325)"><tspan
id="Ord8"
x="20.060436"
y="157.6833"
style="stroke-width:0.264583">8</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="162.68434"
id="Ord9Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.614661,-202.32325)"><tspan
id="Ord9"
x="20.060436"
y="162.68434"
style="stroke-width:0.264583">9</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="167.68538"
id="Ord10Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4575921,-202.32325)"><tspan
id="Ord10"
x="20.060436"
y="167.68538"
style="stroke-width:0.264583">10</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="172.68642"
id="Ord11Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.7934778,-202.32325)"><tspan
id="Ord11"
x="20.060436"
y="172.68642"
style="stroke-width:0.264583">11</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="177.68745"
id="Ord12Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4696744,-202.32325)"><tspan
id="Ord12"
x="20.060436"
y="177.68745"
style="stroke-width:0.264583">12</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="182.68849"
id="Ord13Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.451551,-202.32325)"><tspan
id="Ord13"
x="20.060436"
y="182.68849"
style="stroke-width:0.264583">13</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="187.68953"
id="Ord14Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4588004,-202.32325)"><tspan
id="Ord14"
x="20.060436"
y="187.68953"
style="stroke-width:0.264583">14</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="192.69057"
id="Ord15Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4382606,-202.32325)"><tspan
id="Ord15"
x="20.060436"
y="192.69057"
style="stroke-width:0.264583">15</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="197.6916"
id="Ord16Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4527593,-202.32325)"><tspan
id="Ord16"
x="20.060436"
y="197.6916"
style="stroke-width:0.264583">16</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="202.69263"
id="Ord17Text"
clip-path="url(#clipPath31703)"
transform="matrix(1.7535341,0,0,1.7535341,7.451551,-202.32325)"><tspan
id="Ord17"
x="20.060436"
y="202.69263"
style="stroke-width:0.264583">17</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="207.69366"
id="Ord18Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4479264,-202.32325)"><tspan
id="Ord18"
x="20.060436"
y="207.69366"
style="stroke-width:0.264583">18</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="212.6947"
id="Ord19Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4479264,-202.32325)"><tspan
id="Ord19"
x="20.060436"
y="212.6947"
style="stroke-width:0.264583">19</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="217.69574"
id="Ord20Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6523092,-202.32325)"><tspan
id="Ord20"
x="20.060436"
y="217.69574"
style="stroke-width:0.264583">20</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="222.69678"
id="Ord21Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.7934778,-202.32325)"><tspan
id="Ord21"
x="20.060436"
y="222.69678"
style="stroke-width:0.264583">1</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="227.69781"
id="Ord22Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6643914,-202.32325)"><tspan
id="Ord22"
x="20.060436"
y="227.69781"
style="stroke-width:0.264583">2</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="232.69885"
id="Ord23Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6170774,-202.32325)"><tspan
id="Ord23"
x="20.060436"
y="232.69885"
style="stroke-width:0.264583">3</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="237.69989"
id="Ord24Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.69682,-202.32325)"><tspan
id="Ord24"
x="20.060436"
y="237.69989"
style="stroke-width:0.264583">4</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="242.70093"
id="Ord25Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6049952,-202.32325)"><tspan
id="Ord25"
x="20.060436"
y="242.70093"
style="stroke-width:0.264583">5</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="247.70197"
id="Ord26Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6291596,-202.32325)"><tspan
id="Ord26"
x="20.060436"
y="247.70197"
style="stroke-width:0.264583">6</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="252.703"
id="Ord27Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.603787,-202.32325)"><tspan
id="Ord27"
x="20.060436"
y="252.703"
style="stroke-width:0.264583">7</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="257.70404"
id="Ord28Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.6170774,-202.32325)"><tspan
id="Ord28"
x="20.060436"
y="257.70404"
style="stroke-width:0.264583">8</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="262.70508"
id="Ord29Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.614661,-202.32325)"><tspan
id="Ord29"
x="20.060436"
y="262.70508"
style="stroke-width:0.264583">9</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="267.70612"
id="Ord30Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4575921,-202.32325)"><tspan
id="Ord30"
x="20.060436"
y="267.70612"
style="stroke-width:0.264583">10</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="272.70715"
id="Ord31Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.7934778,-202.32325)"><tspan
id="Ord31"
x="20.060436"
y="272.70715"
style="stroke-width:0.264583">11</tspan></text>
<text
xml:space="preserve"
style="font-size:2.82223px;line-height:normal;font-family:Arial;-inkscape-font-specification:Arial;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#000000;stroke-width:0.264583;stop-color:#000000"
x="20.060436"
y="277.70819"
id="Ord32Text"
clip-path="none"
transform="matrix(1.7535341,0,0,1.7535341,7.4696744,-202.32325)"><tspan
id="Ord32"
x="20.060436"
y="277.70819"
style="stroke-width:0.264583">12</tspan></text>
<path
style="opacity:0.5;fill:none;stroke:#0044aa;stroke-width:2.23429;stroke-dasharray:none;stop-color:#000000"
d="M 129.52842,31.583954 V 200.58582"
id="path692" /></g>
</svg>
Here's the result of the rasterization from firefox with the pdf generated by the previous version of VectSharp.SVG:
Here's the result of the rasterization from firefox with the pdf generated by the current version of VectSharp.SVG:
Here's the result of the rasterization from firefox with the pdf generated by iText: ItextPOC.pdf
Here's the result of the rasterization from firefox with the pdf generated by inkscape: InkscapePOC.pdf
Note, I've been playing around with the clippings in case that's what is causing the issue, here's a different svg file which I have yet to test:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="210mm" height="297mm" version="1.1" viewBox="0 0 210 297" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="#231f20" stroke-width="1.7148">
<path d="m98.3 82.224h62.456v-41.924h-62.456z"/><path d="m98.3 137.27h62.456v-41.924h-62.456z"/><path d="m98.3 188.8h62.456v-41.924h-62.456z"/></g><g fill="#000000" font-family="Arial" font-size="2.8222px" stroke-width=".26458" text-anchor="middle">
<text transform="matrix(4.8607 0 0 4.8607 -789.47 -43.526)" x="189.17186" y="22.57243" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="189.17186" y="22.57243" stroke-width=".26458">1</tspan></text>
<text transform="matrix(4.8607 0 0 4.8607 -789.83 11.515)" x="189.17186" y="22.57243" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="189.17186" y="22.57243" stroke-width=".26458">2</tspan></text>
<text id="Page1Text" transform="matrix(4.8607 0 0 4.8607 -789.96 62.96)" x="189.17186" y="22.57243" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="189.17186" y="22.57243" stroke-width=".26458">3</tspan></text></g><g fill="none" stroke="#231f20"><g stroke-width=".088194">
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 124.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 129.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 134.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 139.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 144.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 149.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 154.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 159.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 164.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 169.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 174.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 179.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 184.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 189.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 194.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 199.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 204.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 209.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 214.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 219.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 224.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 229.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 234.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 239.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 244.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 249.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 254.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 259.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 264.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 269.25h7.8779"/>
<path transform="matrix(1.7535 0 0 1.7535 7.6074 -202.32)" d="m16.122 274.25h7.8779"/>
</g><path d="m35.878 287.35h13.814" stroke-width=".15465"/></g><g fill="#000000" font-family="Arial" font-size="2.8222px" stroke-width=".26458" text-anchor="middle">
<text id="Ord1Text" transform="matrix(1.7535 0 0 1.7535 7.7935 -202.32)" x="20.060436" y="122.67604" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="122.67604" stroke-width=".26458">1</tspan></text>
<text id="Ord2Text" transform="matrix(1.7535 0 0 1.7535 7.6644 -202.32)" x="20.060436" y="127.67708" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="127.67708" stroke-width=".26458">2</tspan></text>
<text id="Ord3Text" transform="matrix(1.7535 0 0 1.7535 7.6171 -202.32)" x="20.060436" y="132.67812" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="132.67812" stroke-width=".26458">3</tspan></text>
<text id="Ord4Text" transform="matrix(1.7535 0 0 1.7535 7.6968 -202.32)" x="20.060436" y="137.67915" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="137.67915" stroke-width=".26458">4</tspan></text>
<text id="Ord5Text" transform="matrix(1.7535 0 0 1.7535 7.605 -202.32)" x="20.060436" y="142.68019" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="142.68019" stroke-width=".26458">5</tspan></text>
<text id="Ord6Text" transform="matrix(1.7535 0 0 1.7535 7.6292 -202.32)" x="20.060436" y="147.68123" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="147.68123" stroke-width=".26458">6</tspan></text>
<text id="Ord7Text" transform="matrix(1.7535 0 0 1.7535 7.6038 -202.32)" x="20.060436" y="152.68227" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="152.68227" stroke-width=".26458">7</tspan></text>
<text id="Ord8Text" transform="matrix(1.7535 0 0 1.7535 7.6171 -202.32)" x="20.060436" y="157.6833" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="157.6833" stroke-width=".26458">8</tspan></text>
<text id="Ord9Text" transform="matrix(1.7535 0 0 1.7535 7.6147 -202.32)" x="20.060436" y="162.68434" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="162.68434" stroke-width=".26458">9</tspan></text>
<text id="Ord10Text" transform="matrix(1.7535 0 0 1.7535 7.4576 -202.32)" x="20.060436" y="167.68538" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="167.68538" stroke-width=".26458">10</tspan></text>
<text id="Ord11Text" transform="matrix(1.7535 0 0 1.7535 7.7935 -202.32)" x="20.060436" y="172.68642" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="172.68642" stroke-width=".26458">11</tspan></text>
<text id="Ord12Text" transform="matrix(1.7535 0 0 1.7535 7.4697 -202.32)" x="20.060436" y="177.68745" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="177.68745" stroke-width=".26458">12</tspan></text>
<text id="Ord13Text" transform="matrix(1.7535 0 0 1.7535 7.4516 -202.32)" x="20.060436" y="182.68849" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="182.68849" stroke-width=".26458">13</tspan></text>
<text id="Ord14Text" transform="matrix(1.7535 0 0 1.7535 7.4588 -202.32)" x="20.060436" y="187.68953" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="187.68953" stroke-width=".26458">14</tspan></text>
<text id="Ord15Text" transform="matrix(1.7535 0 0 1.7535 7.4383 -202.32)" x="20.060436" y="192.69057" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="192.69057" stroke-width=".26458">15</tspan></text>
<text id="Ord16Text" transform="matrix(1.7535 0 0 1.7535 7.4528 -202.32)" x="20.060436" y="197.6916" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="197.6916" stroke-width=".26458">16</tspan></text>
<text id="Ord17Text" transform="matrix(1.7535 0 0 1.7535 7.4516 -202.32)" x="20.060436" y="202.69263" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="202.69263" stroke-width=".26458">17</tspan></text>
<text id="Ord18Text" transform="matrix(1.7535 0 0 1.7535 7.4479 -202.32)" x="20.060436" y="207.69366" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="207.69366" stroke-width=".26458">18</tspan></text>
<text id="Ord19Text" transform="matrix(1.7535 0 0 1.7535 7.4479 -202.32)" x="20.060436" y="212.6947" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="212.6947" stroke-width=".26458">19</tspan></text>
<text id="Ord20Text" transform="matrix(1.7535 0 0 1.7535 7.6523 -202.32)" x="20.060436" y="217.69574" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="217.69574" stroke-width=".26458">20</tspan></text>
<text id="Ord21Text" transform="matrix(1.7535 0 0 1.7535 7.7935 -202.32)" x="20.060436" y="222.69678" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="222.69678" stroke-width=".26458">1</tspan></text>
<text id="Ord22Text" transform="matrix(1.7535 0 0 1.7535 7.6644 -202.32)" x="20.060436" y="227.69781" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="227.69781" stroke-width=".26458">2</tspan></text>
<text id="Ord23Text" transform="matrix(1.7535 0 0 1.7535 7.6171 -202.32)" x="20.060436" y="232.69885" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="232.69885" stroke-width=".26458">3</tspan></text>
<text id="Ord24Text" transform="matrix(1.7535 0 0 1.7535 7.6968 -202.32)" x="20.060436" y="237.69989" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="237.69989" stroke-width=".26458">4</tspan></text>
<text id="Ord25Text" transform="matrix(1.7535 0 0 1.7535 7.605 -202.32)" x="20.060436" y="242.70093" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="242.70093" stroke-width=".26458">5</tspan></text>
<text id="Ord26Text" transform="matrix(1.7535 0 0 1.7535 7.6292 -202.32)" x="20.060436" y="247.70197" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="247.70197" stroke-width=".26458">6</tspan></text>
<text id="Ord27Text" transform="matrix(1.7535 0 0 1.7535 7.6038 -202.32)" x="20.060436" y="252.703" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="252.703" stroke-width=".26458">7</tspan></text>
<text id="Ord28Text" transform="matrix(1.7535 0 0 1.7535 7.6171 -202.32)" x="20.060436" y="257.70404" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="257.70404" stroke-width=".26458">8</tspan></text>
<text id="Ord29Text" transform="matrix(1.7535 0 0 1.7535 7.6147 -202.32)" x="20.060436" y="262.70508" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="262.70508" stroke-width=".26458">9</tspan></text>
<text id="Ord30Text" transform="matrix(1.7535 0 0 1.7535 7.4576 -202.32)" x="20.060436" y="267.70612" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="267.70612" stroke-width=".26458">10</tspan></text>
<text id="Ord31Text" transform="matrix(1.7535 0 0 1.7535 7.7935 -202.32)" x="20.060436" y="272.70715" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="272.70715" stroke-width=".26458">11</tspan></text>
<text id="Ord32Text" transform="matrix(1.7535 0 0 1.7535 7.4697 -202.32)" x="20.060436" y="277.70819" stop-color="#000000" text-align="center" style="line-height:normal;text-decoration-color:#000000" xml:space="preserve"><tspan x="20.060436" y="277.70819" stroke-width=".26458">12</tspan></text>
</g><path d="m129.53 31.584v169" fill="none" opacity=".5" stop-color="#000000" stroke="#04a" stroke-width="2.2343"/>
</svg>
Strangely this new file is rendering with no text at all
Thanks for all your help!
Hi! So, there were three issues that were causing the mis-alignment of the 1 and 11:
All of these should be fixed in VectSharp.SVG 1.8.2-a6 and VectSharp 2.5.0-a1 (you will need to update both NuGet packages).
VectSharp 2.5.0-a1 also has two new font library classes:
FolderFontLibrary
, which can be used to resolve fonts from a folder (e.g. C:\Windows\Fonts
).MultiFontLibrary
, which can be used to "concatenate" multiple font libraries (e.g., if you have multiple folders, you could create a FolderFontLibrary
for each of them, and then join them in a MultiFontLibrary
).I think this is the closest we'll get to a "system fonts" library (at least for now)... The problem is that while on Windows the system fonts are always in the same folder, on other OSs there may be multiple folders, and it would take a lot of guesswork to figure out where they are (Environment.GetFolderPath(Environment.SpecialFolder.Fonts)
is not reliable). Furthermore, VectSharp only supports TrueType fonts, so if someone has incompatible OpenType fonts, these will not work. This is why (in general) I advocate shipping fonts with the app and/or only using the standard fonts.
For the page size issue, I have made a small change, allowing other types of units other than px
to be parsed correctly. If you want the page to have the same size in Inkscape as in the finished PDF file without having to scale it, you should go in the document properties in Inkscape, and make sure that the units are expressed in pt
(for an A4 sheet of paper, these should be ~595x842pt). This will allow you to remove the scaling bit in the code (as the Page
size is now expressed in the same unit as the units of a PDF file).
Finally, the problem with the second file was that the font family attribute was set in a parent g
object, rather than on the text
objects themselves, and this was not propagated. This is also solved in the latest version.
So, in short:
Replace all the simpleFontLibrary
code:
// OLD
/* SimpleFontLibrary fontLibrary = new SimpleFontLibrary();
var fontPath = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
fontLibrary.Add(Path.Join(fontPath, "arialbd.ttf")); // Arial Bold
fontLibrary.Add(Path.Join(fontPath, "ariali.ttf")); // Arial Italic
fontLibrary.Add(Path.Join(fontPath, "arialbi.ttf")); // Arial Bold Italic
fontLibrary.Add(Path.Join(fontPath, "arial.ttf")); // Arial Regular - ALWAYS load the regular font last!
FontFamily.DefaultFontLibrary = fontLibrary; */
// NEW
FontFamily.DefaultFontLibrary = new FolderFontLibrary(Environment.GetFolderPath(Environment.SpecialFolder.Fonts));
Remove all the scaling code:
// OLD
/* double scalingFactor = 72 / 25.4;
var scaledvectSharpPage = new Page(vectSharpPage.Width * scalingFactor, vectSharpPage.Height * scalingFactor);
scaledvectSharpPage.Graphics.Scale(scalingFactor, scalingFactor);
scaledvectSharpPage.Graphics.DrawGraphics(0, 0, vectSharpPage.Graphics);
vectSharpPdf.Pages.Add(scaledvectSharpPage); */
// NEW
vectSharpPdf.Pages.Add(vectSharpPage);
I hope I got everything, please let me know if you have other issues!
Hats off, everything is working flawlessly!
I only have one question left: Do you accept donations?
Glad to hear that it worked! Let me know if you have any other issues.
Thank you for the thought, I had actually never considered it... I need to figure out if I can do this legally!
Greetings!
First of all congratulations and thanks for having such an amazing project I wish I had discovered if before.
I'm using an SVG file as a template for some documents, I've been using iText but I'm considering moving over to VectSharp.
Unfortunately I've detected some problems with the file I'm trying to convert to PDF.
The workflow I use is:
1) Load the SVG as xml and edit nodes as needed 2) Load the edited SVG as a document page 3) Save as PDF
Particularities of my SVG file:
To have a behaviour similar to a form (so text doesn't overfloq) a clipping path is defined over certain text elements. Some text is alinged left or right. It includes an embbeded raster PNG. Page/document size is A4 210mm X 297mm Uses Arial Font
When following this workflow with iText the end result is satisfactory but with VectSharp I noticed the following problems:
I can't specify Fonts when loading an SVG file with the Parer class, it defaults to Helvetica on my system. Page/document size is 74.1mm x 104.8mm instead of A4 size (210mm X 297mm) (Is this due to using inches instead of cm/mm on some conversions?). Clipping paths are ignored and text overflows. The raster image is imported as RectangleAction instead of RasterImageAction.
Thanks for your time and support!
Here´s the Proof Of Concept code:
Here's the svg as raster with annotations in blue (annotations not included in the svg itself):
Here's the svg file itself:
Here's a zipfile with a sample csproj and the output pdf files vectSharpPOC.zip
VectSharp pdf (included in the above zip) as raster:
iText pdf (included in the above zip) as raster: