PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

PDFsharp Path Markup Syntax
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3600
Page 1 of 1

Author:  KruNo [ Wed Jun 14, 2017 11:53 am ]
Post subject:  PDFsharp Path Markup Syntax

Hello,

Is there a way to work in PDFsharp with path markup syntax?

In WPF I work with these Code
Code:
string test = "F1 M 39.2598,21.6194C 47.9001,21.6194 55.3802,24.406 59,28.4646L 59,33.4834C 56.3537,29.575 49.2267,26.7756 40.85,26.7756C 30.2185,26.7756 21.6,31.285 21.6,36.8475C 21.6,40.4514 25.2176,43.6131 30.6564,45.3929C 22.7477,43.5121 17.2,39.1167 17.2,33.9944C 17.2,27.1599 27.0765,21.6194 39.2598,21.6194 Z M 35.8402,51.9929C 27.1999,51.9929 19.7198,49.2063 16.1,45.1478L 15,40.129C 17.6463,44.0373 25.8733,46.8367 34.25,46.8367C 44.8815,46.8367 53.5,42.3274 53.5,36.7648C 53.5,33.161 49.8824,29.9992 44.4436,28.2194C 52.3523,30.1002 57.9,34.4956 57.9,39.6179C 57.9,46.4525 48.0235,51.9929 35.8402,51.9929 Z ";

PathGeometry geo = new PathGeometry();
Path p = new Path();
PathFigureCollectionConverter pConv = new PathFigureCollectionConverter();
GeometryConverter gConv = new GeometryConverter();
           
Geometry ggg = (Geometry)gConv.ConvertFromInvariantString(test);
p.Data = ggg;
p.Stroke = Brushes.Black;
p.StrokeThickness = 1;


Is there a way to implement this with PDFsharp?

Best Regards,
Noel

Author:  Thomas Hoevel [ Wed Jun 14, 2017 3:32 pm ]
Post subject:  Re: PDFsharp Path Markup Syntax

Hi!

Not my area of expertise.

The class "XGraphicsPath" uses a "PathGeometry" object internally, but does not take "PathGeometry" as an input parameter.

So maybe check the "XGraphicsPath.cs" file.

"PathGeometry" could be a red herring in your code snippet.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/