HTML JPG PDF XML DOCX
  Product Family
PDF

.NET SDKでPDFを作成

.NETを使用してPDFドキュメントを作成するためのAPI。

Get Started

クラウド .NET SDKを使用してPDFを作成する方法

PDFドキュメントを作成するには、以下を使用します Aspose.PDF Cloud .NET SDK このクラウドSDKを使用すると、C#、ASP.NET、またはその他の.NET言語で、さまざまなクラウドプラットフォーム向けにクラウドベースのPDF作成、編集、変換アプリケーションを簡単に構築できます。開く NuGet パッケージマネージャーを検索し、 Aspose.PDF Cloud をインストールしてください。パッケージマネージャーコンソールから次のコマンドを使用することもできます。

パッケージマネージャーコンソールコマンド


    PM> Install-Package Aspose.Pdf-Cloud
     

.NET SDKを使用してPDFを作成する手順

Aspose.PDF Cloudの開発者は、ほんの数行のコードでPDFを簡単に読み込み、作成できます。

  1. PDFをアップロードします。
  2. getPageInfo()でページメタデータを取得します。
  3. PDFページを画像として抽出します。
  4. createPdfDocument()で新しい空白のPDFキャンバスを作成します。
  5. 抽出した画像を新しいPDFに挿入します。
  6. 成功を確認し、ダウンロードします。
 

.NETクラウドSDKを使用してPDFを作成


    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!!!");
            }
        }
    }