2toad / pdfsharp Goto Github PK
View Code? Open in Web Editor NEWA .NET library for processing PDF
Home Page: http://pdfsharp.codeplex.com/
License: MIT License
A .NET library for processing PDF
Home Page: http://pdfsharp.codeplex.com/
License: MIT License
I have tried now to set the x-values for a line statistic to the major gridlines. But this does not work. This is how I try it in a ASP.NET MVC application:
var doc = new PdfDocument();
var page = doc.AddPage();
page.Orientation = PdfSharp.PageOrientation.Landscape;
page.Size = PdfSharp.PageSize.A4;
var gfx = XGraphics.FromPdfPage(page);
var chart = new Chart();
chart.Type = ChartType.Line;
chart.YAxis.MajorTickMark = TickMarkType.Outside;
chart.YAxis.LineFormat.Color = XColors.Black;
chart.YAxis.LineFormat.Width = 0.5;
chart.YAxis.LineFormat.Visible = true;
chart.YAxis.TickLabels.Format = "0";
chart.XAxis.MajorTickMark = TickMarkType.None;
chart.XAxis.MinorTickMark = TickMarkType.Outside;
chart.XAxis.LineFormat.Color = XColors.Black;
chart.XAxis.LineFormat.Width = 0.5;
chart.XAxis.LineFormat.Visible = true;
chart.XAxis.MajorTick = 0.0;
chart.XAxis.MinorTick = 0.0;
chart.XAxis.HasMajorGridlines = false;
chart.XAxis.HasMinorGridlines = false;
var series = chart.SeriesCollection.AddSeries();
var yValues = new int[]{ 0, 5, 3, 6, 7 };
series.HasDataLabel = true;
chart.PlotArea.LineFormat.Width = 1;
var xseries = chart.XValues.AddXSeries();
for(var i = 0; i < yValues.Length; i++)
{
series.Add(yValues[i]);
xseries.Add("abc");
}
series.LineFormat.Color = XColors.Orange;
series.MarkerStyle = MarkerStyle.None;
series.LineFormat.Width = 5;
chart.PlotArea.FillFormat.Color = XColors.White;
var chartFrame = new ChartFrame();
chartFrame.Location = new XPoint(20, 80);
chartFrame.Size = new XSize(400, 400);
chartFrame.Add(chart);
chartFrame.DrawChart(gfx);
var ms = new MemoryStream();
doc.Save(ms);
var fileBytes = ms.ToArray();
ms.Close();
return File(fileBytes, "application/pdf", "filename.pdf");
But I expected the red line and the red lettering (drawn by hand):
How can I implement this? Is that even possible? Many thanks.
When installing PDFsharp via NuGet, a PdfSharp.SharpZipLib folder containing a ReadMe.txt file is added to the project. Neither the folder or the file are needed.
The PdfDocumentInformation.Creator property is used to set the value of the Application property within the generated PDF document. Rename the property to to Application for consistency
Change the Target Framework for PdfSharp and PdfSharp.Charting from .NET Framework 2.0 to .NET Framework 4.6.1
The project needs a NuGet spec to support installation via NuGet repositories
The PdfDocumentInformation.Producer property is currently read-only. Add a set accessor to the property so it can be written to.
Create a Visual Studio 2015 solution
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.