TalkingCSharp.PrintityFramework
0.0.3-rc
This is a prerelease version of TalkingCSharp.PrintityFramework.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TalkingCSharp.PrintityFramework --version 0.0.3-rc
NuGet\Install-Package TalkingCSharp.PrintityFramework -Version 0.0.3-rc
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TalkingCSharp.PrintityFramework" Version="0.0.3-rc" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TalkingCSharp.PrintityFramework --version 0.0.3-rc
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TalkingCSharp.PrintityFramework, 0.0.3-rc"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TalkingCSharp.PrintityFramework as a Cake Addin
#addin nuget:?package=TalkingCSharp.PrintityFramework&version=0.0.3-rc&prerelease
// Install TalkingCSharp.PrintityFramework as a Cake Tool
#tool nuget:?package=TalkingCSharp.PrintityFramework&version=0.0.3-rc&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PrintityFramework
A farmework to provide printing and formatting cabapilities to your code within few easy steps
Design
This framework is intended to provide an easy-to-design printing documents with rich designing APIs
Dependency
This framework depends on
- System.Drawing.Common assembly
- PdfSharpCore assembly (this is an older one but we've used it for license)
Nuget package url
Printity framework API reference manual and web demo
- https://printity.azurewebsites.net/ (this is a free hosted service on azure so it'll be slow responding and might be not available sometimes as a free service)
API demo
- Call HTTPPOST to this API: https://printity.azurewebsites.net/api/Demo
- Abd here is a JSON example for the demo
{
"paperSize": "A4",
"tables": [
{
"columns": [
{
"propertyName": "Index",
"headerText": "#",
"width": 25,
"widthUnit": "Percent",
"headerFont": {
"fontName": "Arial",
"bold": true,
"italic": false,
"underline": false,
"size": 12,
"color": {
"colorName": "Black"
}
},
"font": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "Black"
}
},
"alternatingFont": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "Black"
}
},
"headerHAlign": "Center",
"headerVAlien": "Top",
"hAlign": "Center",
"vAlien": "Top",
"backgroundColor": {
"colorName": "White"
},
"headerBackgroundColor": {
"colorName": "White"
},
"alternateBackgroundColor": {
"colorName": null,
"colorHex": "#BBB"
},
"border": {
"borderColor": {
"colorName": "Black"
},
"topBorderColor": {
"colorName": "Black"
},
"leftBorderColor": {
"colorName": "Black"
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "Black"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
},
"headerBorder": {
"borderColor": {
"colorName": "Black"
},
"topBorderColor": {
"colorName": "Black"
},
"leftBorderColor": {
"colorName": "Black"
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "Black"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
}
},
{
"propertyName": "Bool",
"headerText": "Boolean value",
"width": 25,
"widthUnit": "Percent",
"headerFont": {
"fontName": "Arial",
"bold": true,
"italic": false,
"underline": false,
"size": 12,
"color": {
"colorName": "Black"
}
},
"font": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "Black"
}
},
"alternatingFont": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "Black"
}
},
"headerHAlign": "Center",
"headerVAlien": "Top",
"hAlign": "Center",
"vAlien": "Top",
"backgroundColor": {
"colorName": "White"
},
"headerBackgroundColor": {
"colorName": "White"
},
"alternateBackgroundColor": {
"colorName": null,
"colorHex": "#BBB" },
"border": {
"borderColor": {
"colorName": "Black"
},
"topBorderColor": {
"colorName": "Black"
},
"leftBorderColor": {
"colorName": "Black"
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "Black"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
},
"headerBorder": {
"borderColor": {
"colorName": "Black"
},
"topBorderColor": {
"colorName": "Black"
},
"leftBorderColor": {
"colorName": "Black"
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "Black"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
}
},
{
"propertyName": "String",
"headerText": "String value",
"width": 50,
"widthUnit": "Percent",
"headerFont": {
"fontName": "Arial",
"bold": true,
"italic": false,
"underline": false,
"size": 12,
"color": {
"colorName": "Black"
}
},
"font": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "Black"
}
},
"alternatingFont": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "Black"
}
},
"headerHAlign": "Center",
"headerVAlien": "Top",
"hAlign": "Center",
"vAlien": "Top",
"backgroundColor": {
"colorName": "White"
},
"headerBackgroundColor": {
"colorName": "White"
},
"alternateBackgroundColor": {
"colorName": null,
"colorHex": "#BBB" },
"border": {
"borderColor": {
"colorName": "Black"
},
"topBorderColor": {
"colorName": "Black"
},
"leftBorderColor": {
"colorName": "Black"
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "Black"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
},
"headerBorder": {
"borderColor": {
"colorName": "Black"
},
"topBorderColor": {
"colorName": "Black"
},
"leftBorderColor": {
"colorName": "Black"
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "Black"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
}
}
],
"rowHeaderHeight": 10,
"rowHeight": 8,
"bounds": {
"x": 2,
"y": 10,
"width": 96,
"height": 30
},
"boundsUnit": "Percent",
"backgroundColor": {
"colorName": "White"
},
"headerBackgroundColor": {
"colorName": "White"
},
"alternateBackgroundColor": {
"colorName": null,
"colorHex": "#BBB" },
"data": [
{
"Index":1,
"Bool": true,
"String": "First string"
},
{
"Index":2,
"Bool": false,
"String": "Second string"
},
{
"Index":3,
"String": "Third string"
},
{
"Index":4,
"Bool": true,
"String": "Forth string"
},
{
"Index":5,
"Bool": false,
"String": "Fifth string"
},
{
"Index":6,
"String": "Sixth string"
}
]
}
],
"labels": [
{
"backgroundColor": {
"colorName": null,
"colorHex": "#CCC"
},
"bounds": {
"x": 20,
"y": 5,
"width": 60,
"height": 3
},
"boundsUnit": "Percent",
"text": "Printity framework test document",
"font": {
"fontName": "Arial",
"bold": true,
"italic": false,
"underline": false,
"size": 12,
"color": {
"colorName": "Black"
}
},
"hAlign": "Center",
"border": {
"borderColor": {
"colorName": "White",
"colorHex": "#FFF",
"colorR": 255,
"colorG": 255,
"colorB": 255
},
"topBorderColor": {
"colorName": "White",
"colorHex": "#FFF",
"colorR": 255,
"colorG": 255,
"colorB": 255
},
"leftBorderColor": {
"colorName": "White",
"colorHex": "#FFF",
"colorR": 255,
"colorG": 255,
"colorB": 255
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "White",
"colorHex": "#FFF",
"colorR": 255,
"colorG": 255,
"colorB": 255
},
"borderSize": 0,
"topBorderSize": 0,
"leftBorderSize": 0,
"bottomBorderSize": 1,
"rightBorderSize": 0
}
},
{
"backgroundColor": {
"colorName": "White",
"colorHex": "#FFF",
"colorR": 255,
"colorG": 255,
"colorB": 255
},
"bounds": {
"x": 5,
"y": 95,
"width": 90,
"height": 2.5
},
"boundsUnit": "Percent",
"text": "This test document was created using printity framework",
"font": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "DarkRed"}
},
"hAlign": "Left",
"border": {
"borderColor": {
"colorName": "Red"
},
"topBorderColor": {
"colorName": "Red"
},
"leftBorderColor": {
"colorName": "Red"
},
"bottomBorderColor": {
"colorName": "Red"
},
"rightBorderColor": {
"colorName": "Red"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
}
}
],
"placeHeaderValues": [
{
"bounds": {
"x": 40,
"y": 88,
"width": 20,
"height": 2.5
},
"boundsUnit": "Percent",
"headerBounds": {
"x": 20,
"y": 88,
"width": 20,
"height": 2.5
},
"headerBoundsUnit": "Percent",
"header": "Total records",
"text": "6 records",
"font": {
"fontName": "Arial",
"bold": false,
"italic": false,
"underline": false,
"size": 8,
"color": {
"colorName": "Black"
}
},
"headerFont": {
"fontName": "Arial",
"bold": true,
"italic": false,
"underline": false,
"size": 10,
"color": {
"colorName": "Navy"
}
},
"headerHAlign": "Left",
"headerVAlien": "Top",
"hAlign": "Left",
"vAlien": "Top",
"backGroundColor": {
"colorName": "White"
},
"headerBackgroundColor": {
"colorName": null,
"colorHex": "#ABC"
},
"border": {
"borderColor": {
"colorName": "Black"
},
"topBorderColor": {
"colorName": "Black"
},
"leftBorderColor": {
"colorName": "Black"
},
"bottomBorderColor": {
"colorName": "Black"
},
"rightBorderColor": {
"colorName": "Black"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
},
"headerBorder": {
"borderColor": {
"colorName": "Purple"
},
"topBorderColor": {
"colorName": "Purple"
},
"leftBorderColor": {
"colorName": "Purple"
},
"bottomBorderColor": {
"colorName": "Purple"
},
"rightBorderColor": {
"colorName": "Purple"
},
"borderSize": 1,
"topBorderSize": 1,
"leftBorderSize": 1,
"bottomBorderSize": 1,
"rightBorderSize": 1
}
}
]
}
.Net example
public class Data
{
public int Index { get; set; }
public bool? Bool { get; set; }
public string String { get; set; }
}
public void CreateDocument()
{
var data = new List<Data>
{
new Data{ Index = 1, Bool = true, String = "First line" },
new Data{ Index = 2, Bool = false, String = "Second line" },
new Data{ Index = 3, String = "Third line" },
new Data{ Index = 4, Bool = true, String = "Fourth line" },
new Data{ Index = 5, Bool = false, String = "Fifth line" },
new Data{ Index = 6, String = "Sixth line" },
};
var document = new PFW_Document()
.AddTable(new PFW_Table<Data>()
.SetAlternateBackgroundColor(ColorTranslator.FromHtml("#888"))
.SetBackgroundColor(Color.White)
.SetBounds(new RectangleF { X = 2, Y = 10, Width = 96, Height = 30 }, PFW_MeasurementsEnum.Percent)
.SetData(data)
.SetHeaderBackgroundColor(Color.White)
.SetRowHeaderHeight(10)
.SetRowHeight(8)
.AddColumn(new PFW_TableColumn()
.SetBorder(new PFW_Border()
.SetBorderColor(Color.Black)
.SetBorderSize(1))
.SetHAlign(PFW_HorizontalAlignment.Center)
.SetHeaderBorder(new PFW_Border()
.SetBorderSize(1)
.SetBottomBorderColor(Color.Black))
.SetHeaderHAlign(PFW_HorizontalAlignment.Center)
.SetHeaderText("#")
.SetPropertyName("Index")
.SetWidth(25, PFW_MeasurementsEnum.Percent))
.AddColumn(new PFW_TableColumn()
.SetBorder(new PFW_Border()
.SetBorderColor(Color.Black)
.SetBorderSize(1))
.SetHAlign(PFW_HorizontalAlignment.Center)
.SetHeaderBorder(new PFW_Border()
.SetBorderSize(1)
.SetBottomBorderColor(Color.Black))
.SetHeaderHAlign(PFW_HorizontalAlignment.Center)
.SetHeaderText("Boolean")
.SetPropertyName("Bool")
.SetWidth(25, PFW_MeasurementsEnum.Percent))
.AddColumn(new PFW_TableColumn()
.SetBorder(new PFW_Border()
.SetBorderColor(Color.Black)
.SetBorderSize(1))
.SetHAlign(PFW_HorizontalAlignment.Center)
.SetHeaderBorder(new PFW_Border()
.SetBorderSize(1)
.SetBottomBorderColor(Color.Black))
.SetHeaderHAlign(PFW_HorizontalAlignment.Center)
.SetHeaderText("String")
.SetPropertyName("String")
.SetWidth(50, PFW_MeasurementsEnum.Percent))
)
.AddLabel(new PFW_PlaceLabel()
.SetHAlign(PFW_HorizontalAlignment.Center)
.SetBorder(new PFW_Border()
.SetBorderSize(0)
.SetBottomBorderColor(Color.Black)
.SetBottomBorderSize(1))
.SetBounds(new RectangleF(20, 5, 60, 3), PFW_MeasurementsEnum.Percent)
.SetFont(new PFW_Font()
.SetFontName("Arial")
.SetSize(12)
.SetColor(Color.Black)
.SetBold(true))
.SetHAlign(PFW_HorizontalAlignment.Center)
.SetText("Printity framework test document")
.SetBackgroundColor(ColorTranslator.FromHtml("#CCC")))
.AddLabel(new PFW_PlaceLabel()
.SetHAlign(PFW_HorizontalAlignment.Center)
.SetBorder(new PFW_Border()
.SetBorderColor(Color.Red)
.SetBorderSize(1))
.SetBounds(new RectangleF(5, 95, 90, 2.5f), PFW_MeasurementsEnum.Percent)
.SetFont(new PFW_Font()
.SetSize(8)
.SetColor(Color.DarkRed))
.SetText("This test document was created using printity framework"))
.AddHeaderValue(new PFW_PlaceHeaderValue()
.SetBorder(new PFW_Border()
.SetBorderColor(Color.Black)
.SetBorderSize(1))
.SetBounds(new RectangleF(40, 88, 20, 3), PFW_MeasurementsEnum.Percent)
.SetHAlign(PFW_HorizontalAlignment.Center)
.SetHeader("Total records")
.SetHeaderBorder(new PFW_Border()
.SetBorderColor(Color.Black)
.SetBorderSize(1))
.SetHeaderBounds(new RectangleF(20, 88, 20, 3), PFW_MeasurementsEnum.Percent)
.SetHeaderFont(PFW_Defaults.DefaultHeaderFont)
.SetHeaderHAlign(PFW_HorizontalAlignment.Center)
.SetText("6 records"));
document.CreateDocument("file.pdf");
}
project URL
Project URL is where to find the already implemented features and the in-progress ones and the future of this library
- This library's project URL is here: https://github.com/users/Talkingcsharp/projects/4
Final notes
This is an open source project and is unlimitly free to use on your own projects, just please give us a star.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- PdfSharpCore (>= 1.3.9)
- System.Text.Json (>= 6.0.2-mauipre.1.22054.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.