HTML
JPG
PDF
XML
DOCX
PDF
How to create PDF via Cloud .NET SDK
To create PDF documents, we’ll use Aspose.PDF Cloud .NET SDK This Cloud SDK allows you to easily build cloud-based PDF creator, editor & converter apps in C#, ASP.NET, or other .NET languages for various cloud platforms. Open NuGet package manager, search for Aspose.PDF Cloud and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Pdf-Cloud
Steps to create PDF using .NET SDK
Aspose.PDF Cloud developers can easily load & create PDF in just a few lines of code.
- Uploads the PDF.
- Retrieve Page Metadata with getPageInfo().
- Extract PDF Page as Image.
- Create New Blank PDF Canvas with createPdfDocument().
- Insert Extracted Image into New PDF.
- Verify Success and Download.
Create PDF using .NET Cloud SDK
using Aspose.Pdf.Cloud.Sdk.Model;
namespace CreateDocument
{
public class CreatePdfDocument
{
public CreatePdfDocument(CrateDocumentHelper helper)
{
DocumentProperties docProps = new DocumentProperties(
List: new List<DocumentProperty>() {
new DocumentProperty(Name: "prop1", Value: "Value1", BuiltIn: false)
}
);
DisplayProperties dispProps = new DisplayProperties()
{
CenterWindow = true,
HideMenuBar = true,
Direction = Direction.L2R,
DisplayDocTitle = true,
HideToolBar = true,
HideWindowUI = true,
NonFullScreenPageMode = PageMode.UseThumbs,
PageLayout = PageLayout.TwoPageLeft,
PageMode = PageMode.UseThumbs
};
DefaultPageConfig pageConfig = new DefaultPageConfig(helper.config.PAGE_HEIGHT, helper.config.PAGE_WIDTH);
DocumentConfig document_config = new DocumentConfig(
DocumentProperties: docProps,
DisplayProperties: dispProps,
DefaultPageConfig: pageConfig,
PagesCount: helper.config.PAGES_COUNT
);
DocumentResponse response = helper.pdfApi.PostCreateDocument(helper.config.LOCAL_RESULT_DOCUMENT_NAME, document_config, folder: helper.config.TEMP_FOLDER);
if (response != null && response.Code == 200)
Console.WriteLine("Document #{0} created.", helper.config.LOCAL_RESULT_DOCUMENT_NAME);
else
Console.WriteLine("Unexpected error!!!");
}
}
}