0% found this document useful (0 votes)
102 views

Test Code: Abcpdf

This document provides information about the ABCpdf NuGet package: - ABCpdf is a .NET library for generating PDF documents from any .NET application. - Version 13.0.0.6 of the package is described. - Sample code is provided to demonstrate basic usage of the library for creating a PDF with text. - Documentation links and installation instructions are included.

Uploaded by

swadhin_abap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Test Code: Abcpdf

This document provides information about the ABCpdf NuGet package: - ABCpdf is a .NET library for generating PDF documents from any .NET application. - Version 13.0.0.6 of the package is described. - Sample code is provided to demonstrate basic usage of the library for creating a PDF with text. - Documentation links and installation instructions are included.

Uploaded by

swadhin_abap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Downloads Full stats →

ABCpdf 13.0.0.6 (/stats/packages/ABCpdf?


groupby=Version)
.NET 5.0 (/packages/ABCpdf/#supportedframeworks-body-tab) .NET Core 3.0 (/packages/ABCpdf/#supportedframeworks-body-
Total 4.5M
tab) .NET Framework 4.0 (/packages/ABCpdf/#supportedframeworks-body-tab)

Current version 317


.NET CLI Package Manager PackageReference Paket CLI Script & Interactive Cake

Per day average 1.0K


> dotnet add package ABCpdf --version 13.0.0.6 

About

 README  Frameworks  Dependencies  Used By  Versions  Last updated 4 days ago

 Project website
Test Code (https://www.websupergoo.com/abcpdf-
1.htm)

Quite often when creating a new project you want some simple test code to ensure your installation is correct.
 License Info
(/packages/ABCpdf/13.0.0.6/License)
First you need to ensure you are using the correct namespace. Insert the following at the top of your C# module.
 Download package
(https://www.nuget.org/api/v2/package/ABCpdf/13.0.0.6)
using WebSupergoo.ABCpdf13;
(208.09 MB)

If you are in a forms or console application, the following Hello World code may be useful.
 Open in NuGet Package Explorer
(https://nuget.info/packages/ABCpdf/13.0.0.6)
using (Doc doc = new Doc()) {
doc.FontSize = 96; Open in FuGet Package Explorer
doc.AddText("Hello World!"); (https://www.fuget.org/packages/ABCpdf/13.0.0.6)
doc.Save(@"C:\_output.pdf"); // adjust path for your needs
}  Report package
(/packages/ABCpdf/13.0.0.6/ReportAbuse)
Alternatively if you are running under ASP.NET, you may want a Page_Load function something like this.
Owners
Contact owners →
(/packages/ABCpdf/13.0.0.6/ContactOwners)
byte[] theData = null;
using (Doc doc = new Doc()) {
(/profiles/websupergoo) we…
doc.FontSize = 96;
doc.AddText("Hello World!");
theData = doc.GetData();
} PDF (/packages?
Response.Clear();
q=Tags%3A%22PDF%22)
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline; filename=MyPDF.PDF"); ABCpdf (/packages?
Response.AddHeader("content-length", theData.Length.ToString());
q=Tags%3A%22ABCpdf%22)
Response.BinaryWrite(theData);
Response.End(); HTML (/packages?
q=Tags%3A%22HTML%22) EPS
For more example projects, please download the installer bundle from the ABCpdf download site.
(/packages?

q=Tags%3A%22EPS%22) XPS
Documentation (/packages?
q=Tags%3A%22XPS%22)
Documentation for ABCpdf can be found here:
HTML-to-PDF (/packages?
https://www.websupergoo.com/helppdfnet/ (https://www.websupergoo.com/helppdfnet/) q=Tags%3A%22HTML-to-
PDF%22) C#-HTML-to-PDF
Alternatively you can download the installer bundle from the ABCpdf download site as this contains full documentation
in CHM format. (/packages?q=Tags%3A%22C%23-

HTML-to-PDF%22) EPS-to-PDF

Installation (/packages?q=Tags%3A%22EPS-

to-PDF%22) library (/packages?


ABCpdf is an Xcopy deployment. All that is needed is that the DLLs and associated files be copied to your bin q=Tags%3A%22library%22)
directory.
2002-2024 WebSupergoo Software
This should happen automatically because it is what is specified in the NuGet installer. However not all platforms and
not all project types do this reliably.

(https://www.facebook.com/sharer/sharer.php?
For example if you select the Visual Studio "Create Web Site" option and then select an "ASP.NET Web Forms Site"
u=https://nuget.org/packages/ABCpdf/&t=Check+out+ABCpdf+on+%23NuGet.)
you will get a web site without a project file. NuGet requires a project file for certain types of installations so it will leave
some DLLs out. However if you instead select "Create Project" and select an "ASP.NET Web Application" then this will
(https://twitter.com/intent/tweet?
work fine.
url=https://nuget.org/packages/ABCpdf/&text=Check+out+ABCpdf+on+%23NuGet.)
(/packages/ABCpdf/atom.xml)
Here we explain the installation process in case you need to do anything yourself.

At minimum you only need either ABCpdf.dll or ABCpdf.NET5.dll (for .NET 4 and .NET 5 respectively) and either
ABCpdf13-32.dll or ABCpdf13-64.dll (for x86 and x64 respectively). If you are not sure then just copy all of them to
your bin directory.

The extra DLLs and files which come with ABCpdf provide extra functionality like HTML import, 3D rendering and
AcroForm JavaScript. They are not required for all deployments but we copy them to the bin directory as standard in
case you need them.

For more details please see the Manual Installation section of the documentation.

License
When you run the installer a trial license is created for you. If you do not have a valid license - either full or trial - then
an exception will be raised when you use methods like Doc.Save.

Most notably, if you Xcopy deploy to another machine, the license is not copied. So if you push your bin directory up
to a machine in the cloud, you need to ensure that it gets a copy of your license.

To do this you can use code of the following form to be called before any ABCpdf objects are created.

if (!XSettings.InstallLicense(" **** insert your license key here *** ")) {


Response.Write("Could not install trial license. ");
Response.Write("You have: " + XSettings.LicenseDescription);
return;
}

The license key you need to insert will typically be a trial key which looks something like this.

"XeJREBodo/8B4SFWbfuBP42jLr5NPdtypry10sywB1pg4nufPib5NccZcUJK72QFBw=="

You can get your trial key from PDFSettings.exe - part of the ABCpdf installation. Alternatively you can run the
following ASP.NET code to report your trial license.

Response.Write("Code for installation of trial license:</br>");


string key = System.Web.HttpUtility.HtmlEncode(XSettings.Key);
Response.Write("if (!XSettings.InstallLicense(\"" + key + "\")) {..</br>");

*** Azure ***

It is important to understand that Azure is not one thing - it is a set of varied types of virtual machines and devices.
Some are simpler, cheaper and more restrictive. Some are more sophisticated.

Azure is also a rapidly moving target. What is current and default now, may not be in the future. With a growth of
almost 100% every year, you have to expect a certain amount of change and perhaps even some rough edges.

ABCpdf will run on the default Azure instances. However the simpler default Azure instances do not have the features
required for functionality like HTML import. For those you need a slightly different model. See our Azure deployment
guide for details.

http://www.websupergoo.com/support-azure-abcpdf.htm (http://www.websupergoo.com/support-azure-abcpdf.htm)

Sometimes ASP.NET Azure deployments are 32 bit. The platform itself is x64 but it may run code, by default, in a 32
bit space. You may wish to change this in your Azure settings.

Contact (/policies/Contact) Status (https://status.nuget.org/) FAQ (Frequently Asked Questions)


Got questions about NuGet or the NuGet Gallery? Find out the service status of NuGet.org and its (https://aka.ms/nuget-faq)
related services. Read the Frequently Asked Questions about
NuGet and see if your question made the list.

© Microsoft 2024 - About (/policies/About) - Terms of Use (/policies/Terms) - Privacy Policy (https://go.microsoft.com/fwlink/?LinkId=521839)
- Trademarks (https://www.microsoft.com/trademarks)

You might also like