Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/MigraDocCore/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MigraDocCore will create PDF documents.

## First steps

Both PDFsharpCore and MigraDocCore provide a lot of `AddXxx` functions.
Both PdfSharpCore and MigraDocCore provide a lot of `AddXxx` functions.
Typically these functions return the newly created objects. Once you’ve learned the basic principles it’s quite easy to work with.
Intellisense helps a lot then.

Expand Down
2 changes: 1 addition & 1 deletion docs/MigraDocCore/samples/HelloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void Main(string[] args)
// This setting has no effect on the RTF renderer.
// (The term 'font program' is used by Adobe for a file containing a font. Technically a 'font file'
// is a collection of small programs and each program renders the glyph of a character when executed.
// Using a font in PDFsharpCore may lead to the embedding of one or more font programs, because each outline
// Using a font in PdfSharpCore may lead to the embedding of one or more font programs, because each outline
// (regular, bold, italic, bold+italic, ...) has its own font program)
const PdfFontEmbedding embedding = PdfFontEmbedding.Always;

Expand Down
2 changes: 1 addition & 1 deletion docs/MigraDocCore/samples/Invoice.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Invoice

Shows how to create a simple invoice of a fictional book store.
The invoice document is created with the MigraDocCore document object model and then rendered to PDF with PDFsharpCore.
The invoice document is created with the MigraDocCore document object model and then rendered to PDF with PdfSharpCore.


## Creating the Document
Expand Down
8 changes: 4 additions & 4 deletions docs/MigraDocCore/samples/MixMigraDocCoreAndPDFsharpCore.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mix MigraDocCore and PDFsharpCore
# Mix MigraDocCore and PdfSharpCore

Demonstrates how to mix MigraDocCore and PDFsharpCore.
Demonstrates how to mix MigraDocCore and PdfSharpCore.


## Creating the Document
Expand All @@ -14,10 +14,10 @@ static void Main()
string filename = "MixMigraDocCoreAndPdfSharpCore.pdf";
filename = Guid.NewGuid().ToString("D").ToUpper() + ".pdf";
PdfDocument document = new PdfDocument();
document.Info.Title = "PDFsharpCore XGraphic Sample";
document.Info.Title = "PdfSharpCore XGraphic Sample";
document.Info.Author = "Stefan Lange";
document.Info.Subject = "Created with code snippets that show the use of graphical functions";
document.Info.Keywords = "PDFsharpCore, XGraphics";
document.Info.Keywords = "PdfSharpCore, XGraphics";

SamplePage1(document);
SamplePage2(document);
Expand Down
2 changes: 1 addition & 1 deletion docs/MigraDocCore/samples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Samples for [MigraDocCore](../index.md):
* [Hello MigraDocCore](HelloMigraDocCore.md)
* [Images](Images.md)
* [Invoice](Invoice.md)
* [Mix MigraDocCore and PDFsharpCore](MixMigraDocCoreAndPDFsharpCore.md)
* [Mix MigraDocCore and PdfSharpCore](MixMigraDocCoreAndPDFsharpCore.md)
62 changes: 31 additions & 31 deletions docs/PdfSharpCore/faq.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# PDFsharpCore > FAQ
# PdfSharpCore > FAQ

FAQ for [PDFsharpCore](index.md):
FAQ for [PdfSharpCore](index.md):


## What is PDFsharpCore
## What is PdfSharpCore

PDFsharpCore is a .NET library for creating and modifying Adobe PDF documents programmatically. It is written in C# and can be used from any .NET language.
PdfSharpCore is a .NET library for creating and modifying Adobe PDF documents programmatically. It is written in C# and can be used from any .NET language.


## Is PDFsharpCore based on or does it require other libraries or tools?
## Is PdfSharpCore based on or does it require other libraries or tools?

PDFsharpCore is newly designed and built from scratch in C#. Neither Adobe's PDF Library nor Acrobat are required.
PdfSharpCore is newly designed and built from scratch in C#. Neither Adobe's PDF Library nor Acrobat are required.


## What is the license of PDFsharpCore?
## What is the license of PdfSharpCore?

PDFsharpCore is Open Source. You can copy, modify and integrate the source code of PDFsharpCore in your application without restrictions at all.
PdfSharpCore is Open Source. You can copy, modify and integrate the source code of PdfSharpCore in your application without restrictions at all.

See also: PDFsharpCore [license](../../LICENCE.md)
See also: PdfSharpCore [license](../../LICENCE.md)


## Can PDFsharpCore show PDF files? Print PDF files? Create images from PDF files?
## Can PdfSharpCore show PDF files? Print PDF files? Create images from PDF files?

PDFsharpCore comes with a preview control designed to visualize drawing operations of the XGraphics object, but it cannot render PDF files.
PdfSharpCore comes with a preview control designed to visualize drawing operations of the XGraphics object, but it cannot render PDF files.

Further the DrawImage function can be used to draw so called form XObjects in PDF pages. If you try to render such an object in the preview, only the bounding box is drawn to show that it cannot be rendered.

The PDFsharpCore [samples](samples/index.md) show how to invoke Adobe Reader or Acrobat to view or print PDF files and how to invoke GhostScript to create images from PDF pages.
The PdfSharpCore [samples](samples/index.md) show how to invoke Adobe Reader or Acrobat to view or print PDF files and how to invoke GhostScript to create images from PDF pages.


## Can I use PostScript fonts with PDFsharpCore?
## Can I use PostScript fonts with PdfSharpCore?

PDFsharpCore cannot work with PostScript fonts. Only TrueType fonts and OpenType fonts with TrueType outlines can be used with PDFsharpCore. Read more...
PdfSharpCore cannot work with PostScript fonts. Only TrueType fonts and OpenType fonts with TrueType outlines can be used with PdfSharpCore. Read more...


## Can PDFsharpCore run on Web Servers under Medium Trust?
## Can PdfSharpCore run on Web Servers under Medium Trust?

You can run applications on web servers without full trust provided you only use fonts that are serviced by your own FontResolver. See the PDFsharpCore sample: [Font Resolver](samples/FontResolver.md) for further information.
You can run applications on web servers without full trust provided you only use fonts that are serviced by your own FontResolver. See the PdfSharpCore sample: [Font Resolver](samples/FontResolver.md) for further information.


## Does PDFsharpCore support for Arabic, Hebrew, CJK (Chinese, Japanese, Korean)?
## Does PdfSharpCore support for Arabic, Hebrew, CJK (Chinese, Japanese, Korean)?

Not yet. Right-to-left languages are not yet supported. Only simple languages like English or German are supported, with an easy one-to-one relationship between characters and glyphs.

Expand All @@ -49,35 +49,35 @@ It seems that Hebrew works if you reverse the strings and set all paragraphs to

Japanese characters will be displayed, but left to right and not top to bottom. We cannot read Japanese and cannot verify they are shown correctly. Make sure you select a font that contains Japanese characters.

Arabic characters have different shapes (glyphs), depending on their position (beginning, end, middle, isolated). PDFsharpCore does not support the selection of the correct glyphs. Arabic text may work if you reverse the string and if you make sure to select the correct Unicode characters for beginning, end, middle, or isolated display. Make sure you select a font that contains Arabic characters.
Arabic characters have different shapes (glyphs), depending on their position (beginning, end, middle, isolated). PdfSharpCore does not support the selection of the correct glyphs. Arabic text may work if you reverse the string and if you make sure to select the correct Unicode characters for beginning, end, middle, or isolated display. Make sure you select a font that contains Arabic characters.


## Which PDF versions are supported by PDFsharpCore?
## Which PDF versions are supported by PdfSharpCore?

With PDFsharpCore you can create files with PDF versions from 1.2 (Adobe Acrobat Reader 3.0) through 1.7 (Adobe Reader 8.0).
PDFsharpCore fully supports PDF 1.4 (Adobe Reader 5.0) including the transparency features introduced with this version.
Some features of PDF 1.5 (Adobe Reader 6.0) are not yet implemented. Therefore PDFsharpCore cannot yet open all files marked for PDF 1.5 or higher. Since not all compression features of PDF 1.5 are implemented, with some files the file size may increase when they are processed with PDFsharpCore.
With PdfSharpCore you can create files with PDF versions from 1.2 (Adobe Acrobat Reader 3.0) through 1.7 (Adobe Reader 8.0).
PdfSharpCore fully supports PDF 1.4 (Adobe Reader 5.0) including the transparency features introduced with this version.
Some features of PDF 1.5 (Adobe Reader 6.0) are not yet implemented. Therefore PdfSharpCore cannot yet open all files marked for PDF 1.5 or higher. Since not all compression features of PDF 1.5 are implemented, with some files the file size may increase when they are processed with PdfSharpCore.


## Does PDFsharpCore support PDF/A?
## Does PdfSharpCore support PDF/A?

Not yet.


## Does PDFsharpCore support AcroForms?
## Does PdfSharpCore support AcroForms?

There is limited support for AcroForms included.


## Can I use PDFsharpCore to convert HTML or RTF to PDF?
## Can I use PdfSharpCore to convert HTML or RTF to PDF?

No, not "out of the box", and we do not plan to write such a converter in the near future.

Yes, PDFsharpCore with some extra code can do it. But we do not supply that extra code.
Yes, PdfSharpCore with some extra code can do it. But we do not supply that extra code.
On NuGet and other sources you can find a third party library "HTML Renderer for PDF using PdfSharpCore" that converts HTML to PDF. And there may be other libraries for the same or similar purposes, too. Maybe they work for you, maybe they get you started.


## Can I use PDFsharpCore to convert PDF to Word, RTF, HTML?
## Can I use PdfSharpCore to convert PDF to Word, RTF, HTML?

No, and we do not plan to write such a converter in the near future.

Expand All @@ -87,15 +87,15 @@ No, and we do not plan to write such a converter in the near future.
There is an issue with the PDFs created by SQL Server 2008 Reporting Services. We are working on it.
As a workaround, create reports with SQL Server 2005 Reporting Services. Workaround for SQL Server 2008 Reporting Services: For the DeviceSettings parameter for the Render method on the ReportExecutionService object, pass this value:
`theDeviceSettings = "<DeviceInfo><HumanReadablePDF>True</HumanReadablePDF></DeviceInfo>";`.
This disables PDF file compression for SSRS 2008. Then, PDFSharpCore is able to handle the resulting uncompressed PDF file. (Note: SSRS 2005 ignores this setting so it can be passed to both SSRS versions.)
This disables PDF file compression for SSRS 2008. Then, PdfSharpCore is able to handle the resulting uncompressed PDF file. (Note: SSRS 2005 ignores this setting so it can be passed to both SSRS versions.)


## Can I use PDFsharpCore to extract text from PDF?
## Can I use PdfSharpCore to extract text from PDF?

This can be done at a low level. You can get at the characters in the order they are drawn - and most applications draw them from top-left to bottom-right. There are no high-level functions that return words, paragraphs, or whole pages.


## Can PDFsharpCore simulate Bold or Italics?
## Can PdfSharpCore simulate Bold or Italics?

Not yet.

Expand All @@ -104,4 +104,4 @@ Not yet.

PDF is a vector format, so there are no DPI. Raster images used in a PDF file do have DPI, but DPI is determined by the usage.
Consider an image with 300 DPI. This image can be embedded once in the PDF file, but can be drawn several times. There could be a thumbnail on page 1, a full size reproduction on page 2, and a double size reproduction on page 3. Thus the image is drawn with 600 DPI on page 1, 300 DPI on page 2, and 150 DPI on page 3. But when you watch the PDF file in Adobe Reader with a Zoom factor of 1000%, the DPI value will be much lower than that.
PDF is vector. There is no DPI. PDFsharpCore uses Points as the unit for coordinates. There are 72 Points per Inch. For ease of use, units can be converted from Inch, Centimeter, Millimeter and other units.
PDF is vector. There is no DPI. PdfSharpCore uses Points as the unit for coordinates. There are 72 Points per Inch. For ease of use, units can be converted from Inch, Centimeter, Millimeter and other units.
10 changes: 5 additions & 5 deletions docs/PdfSharpCore/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# PDFsharpCore
# PdfSharpCore

PDFsharpCore is a .NET library for processing PDF file.
PdfSharpCore is a .NET library for processing PDF file.
You create PDF pages using drawing routines known from GDI+.
Almost anything that can be done with GDI+ will also work with PDFsharpCore.
Almost anything that can be done with GDI+ will also work with PdfSharpCore.
Keep in mind it does no longer depend on GDI+, as it was ported to make use of [ImageSharp](https://github.com/SixLabors/ImageSharp).
Only basic text layout is supported by PDFsharpCore, and page breaks are not created automatically.
Only basic text layout is supported by PdfSharpCore, and page breaks are not created automatically.
The same drawing routines can be used for screen, PDF, or meta files.

* [Features](#features)
Expand All @@ -26,7 +26,7 @@ The same drawing routines can be used for screen, PDF, or meta files.

## First steps

Both PDFsharpCore and MigraDocCore provide a lot of `AddXxx` functions.
Both PdfSharpCore and MigraDocCore provide a lot of `AddXxx` functions.
Typically these functions return the newly created objects. Once you’ve learned the basic principles it’s quite easy to work with.
Intellisense helps a lot then.

Expand Down
2 changes: 1 addition & 1 deletion docs/PdfSharpCore/samples/Annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This sample shows how to create PDF annotations.

PDFsharpCore supports the creation of the following annotations:
PdfSharpCore supports the creation of the following annotations:
* [Text annotations](#text-annotations)
* [Text annotations opened](#text-annotations-opened)
* [Rubber stamp annotations](#rubber-stamp-annotations)
Expand Down
4 changes: 2 additions & 2 deletions docs/PdfSharpCore/samples/Clock.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void Page_Load(object sender, EventArgs e)
// Create new PDF document
PdfDocument document = new PdfDocument();
this.time = document.Info.CreationDate;
document.Info.Title = "PDFsharpCore Clock Demo";
document.Info.Title = "PdfSharpCore Clock Demo";
document.Info.Author = "Stefan Lange";
document.Info.Subject = "Server time: " +
this.time.ToString("F", CultureInfo.InvariantCulture);
Expand Down Expand Up @@ -80,7 +80,7 @@ static void DrawText(XGraphics gfx, XPen pen, XBrush brush)
{
XSize size = gfx.PageSize;
XGraphicsPath path = new XGraphicsPath();
path.AddString("PDFsharpCore",
path.AddString("PdfSharpCore",
new XFontFamily("Verdana"), XFontStyle.BoldItalic, 60,
new XRect(0, size.Height / 3.5, size.Width, 0), XStringFormats.Center);
gfx.DrawPath(new XPen(pen.Color, 3), brush, path);
Expand Down
6 changes: 3 additions & 3 deletions docs/PdfSharpCore/samples/ExportImages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This sample shows how to export JPEG images from a PDF file.

Note: This snippet shows how to export JPEG images from a PDF file. PDFsharpCore cannot convert PDF pages to JPEG files. This sample does not handle non-JPEG images. It does not (yet) handle JPEG images that have been flate-encoded.
Note: This snippet shows how to export JPEG images from a PDF file. PdfSharpCore cannot convert PDF pages to JPEG files. This sample does not handle non-JPEG images. It does not (yet) handle JPEG images that have been flate-encoded.

There are several different formats for non-JPEG images in PDF. Those are not supported by this simple sample and require several hours of coding, but this is left as an exercise to the reader.

PDFsharpCore cannot render PDF pages - not to printers, not to bitmaps, not to JPEG files.
PdfSharpCore cannot render PDF pages - not to printers, not to bitmaps, not to JPEG files.


## Code
Expand Down Expand Up @@ -97,6 +97,6 @@ static void ExportAsPngImage(PdfDictionary image, ref int count)
// PdfSharpCore.Pdf.Advanced/PdfImage.cs to see how we create the PDF image formats.
// We don't need that feature at the moment and therefore will not implement it.
// If you write the code for exporting images I would be pleased to publish it in a future release
// of PDFsharpCore.
// of PdfSharpCore.
}
```
6 changes: 3 additions & 3 deletions docs/PdfSharpCore/samples/FontResolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This sample shows how to use fonts that are included with your application. This

For tasks running on web servers, private fonts may be the only available fonts.

Note: The FontResolver is a global object and applies to all consumers of the PDFsharpCore library. It is also used when the MigraDocCore library creates PDF files.
Note: The FontResolver is a global object and applies to all consumers of the PdfSharpCore library. It is also used when the MigraDocCore library creates PDF files.


## The IFontResolver Interface
Expand All @@ -26,10 +26,10 @@ public byte[] GetFont(string faceName)
Now you only need one more step: register your font resolver using the global font resolver property. Here SegoeWpFontResolver is the class that implements IFontResolver.

```cs
// Register font resolver before start using PDFsharpCore.
// Register font resolver before start using PdfSharpCore.
GlobalFontSettings.FontResolver = new SegoeWpFontResolver();
```

## Additional Information

The font resolver set using GlobalFontSettings.FontResolver will be used by PDFsharpCore. Since MigraDocCore uses PDFsharpCore to create PDF files, the font resolver will also be used when generating PDF files from MigraDocCore.
The font resolver set using GlobalFontSettings.FontResolver will be used by PdfSharpCore. Since MigraDocCore uses PdfSharpCore to create PDF files, the font resolver will also be used when generating PDF files from MigraDocCore.
4 changes: 2 additions & 2 deletions docs/PdfSharpCore/samples/Graphics.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ static void Main()
// Create a temporary file
string filename = String.Format("{0}_tempfile.pdf", Guid.NewGuid().ToString("D").ToUpper());
s_document = new PdfDocument();
s_document.Info.Title = "PDFsharpCore XGraphic Sample";
s_document.Info.Title = "PdfSharpCore XGraphic Sample";
s_document.Info.Author = "Stefan Lange";
s_document.Info.Subject = "Created with code snippets that show the use of graphical functions";
s_document.Info.Keywords = "PDFsharpCore, XGraphics";
s_document.Info.Keywords = "PdfSharpCore, XGraphics";

// Create demonstration pages
new LinesAndCurves().DrawPage(s_document.AddPage());
Expand Down
2 changes: 1 addition & 1 deletion docs/PdfSharpCore/samples/HelloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace HelloWorld
{
// Create a new PDF document
PdfDocument document = new PdfDocument();
document.Info.Title = "Created with PDFsharpCore";
document.Info.Title = "Created with PdfSharpCore";

// Create an empty page
PdfPage page = document.AddPage();
Expand Down
4 changes: 2 additions & 2 deletions docs/PdfSharpCore/samples/MultiplePages.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Experience shows that users sometimes have difficulties to modify there code wit

If you know right from the start that you will or may need more than one page, then take this into account right from the start and your program will be readable and easy to maintain.

Note: Consider using MigraDocCore instead of PDFsharpCore for large documents. You can use many attributes to format text and you get the line breaks and page breaks for free.
Note: Consider using MigraDocCore instead of PdfSharpCore for large documents. You can use many attributes to format text and you get the line breaks and page breaks for free.


# Code
Expand Down Expand Up @@ -62,7 +62,7 @@ public class LayoutHelper

And sample code that shows the LayoutHelper class at work. The sample uses short texts that will always fit into a single line. Adding line breaks to texts that do not fit into a single line is beyond the scope of this sample.

I wrote it before: Consider using MigraDocCore instead of PDFsharpCore for large documents. You can use many attributes to format text and you get the line breaks and page breaks for free.
I wrote it before: Consider using MigraDocCore instead of PdfSharpCore for large documents. You can use many attributes to format text and you get the line breaks and page breaks for free.

```cs
PdfDocument document = new PdfDocument();
Expand Down
Loading