ライブ環境でテストする
ウォーターマークなしで本番環境でテストしてください。
必要な場所でいつでも動作します。
PDFドキュメントを扱う際には、ニーズに合った適切なツールを選ぶことが重要な第一歩です。HTMLコンテンツをPDFドキュメントに変換するだけをお望みですか? それとも、PDFプロジェクトに暗号化やデジタル署名の適用などのより高度なツールが必要ですか? 今日は、IronPDFとSelectPdfという2つのPDFライブラリを見て、それらがどのようにあなたのPDFワークスペースを向上させるかを検討します。
IronPDF は、.NETエコシステム内のすべてのPDF関連タスクのワンストップソリューションとして設計されています。 HTML、CSS、JavaScriptおよび複数の画像形式をサポートしているため、Webベースのアプリケーションに非常に適応性があります。 さまざまな機能を備え、PDFの生成、編集、署名や暗号化ができるIronPDFは、アーセナルに追加する素晴らしいツールです。
SelectPdfは、.NET Frameworkおよび.NET Coreプラットフォームの両方で実行できる.NETアプリケーション用の柔軟なHTMLからPDFへのコンバーターを提供します。 それはPDFファイルの作成および既存のPDFドキュメントの操作に豊富な機能を提供し、さまざまなビジネスおよび個人のシナリオに適しています。
IronPDFは幅広いプラットフォームをサポートしており、お好みの環境で作業できるようにしています。 互換性の内訳は以下の通りです:
.NET バージョン:
もちろん、提供された内容は空白ですので、翻訳するテキストはありません。翻訳したい具体的なコンテンツを更新してください。その際に正確に翻訳させていただきます。 (C#、VB.NET、F#)
.NETコア (8, 7, 6, 5, および3.1+)
OSとプロセッサ: Windows、Mac、Linux、x64、x86、ARMを含む複数の異なるOSおよびプロセッサをサポート
詳細については、こちらをご覧ください IronPDFの互換性.
.NET バージョン:
.NET Framework 4.0+
PDF編集機能: IronPDFを使用すると、既存のドキュメントを簡単に編集できます。 IronPDFは、ヘッダーとフッターの追加、テキストや画像をPDFページにスタンプ、PDF文書の結合と分割、カスタム透かしの追加、PDFフォームの操作などの編集機能を提供します。
IronPDFで提供されている機能の詳細については、次のページをご覧ください: IronPDFの機能.
IronPDF:
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from an HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
// An optional BasePath 'c:\site\assets\' is set as the file location to load assets from
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"c:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from an HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
// An optional BasePath 'c:\site\assets\' is set as the file location to load assets from
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"c:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
SelectPdf:
// instantiate an HTML to PDF converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(file);
// close pdf document
doc.Close();
// instantiate an HTML to PDF converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(file);
// close pdf document
doc.Close();
IRON VB CONVERTER ERROR developers@ironsoftware.com
複数のウェブページを同じPDFドキュメントに変換する場合でも、単一のHTML文字列を変換する場合でも、IronPDFはChromePdfRendererを使用し、最新のウェブ標準に対応しているため、高精度のPDFファイルを提供します。 IronPDFを使用すると、変換することができます HTMLからPDF 少しのコード行を使用するだけで。 SelectPdfのHTMLからPDFへの変換ツールは簡潔で実装が迅速ですが、高品質な出力を生成しない場合があります。 PDF。 変換
IronPDFのHTMLからPDFへの変換ツールについて詳しく知りたい場合は、私たちの便利な情報をご覧ください。 使い方 ガイド。
IronPDF:
using IronPdf;
using System;
// Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
// Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
// Edit file security settings
// The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption();
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserFormData = false;
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
// Change or set the document encryption password
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
<br>
using IronPdf;
using System;
// Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
// Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
// Edit file security settings
// The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption();
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserFormData = false;
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
// Change or set the document encryption password
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
<br>
Imports IronPdf
Imports System
' Open an Encrypted File, alternatively create a new PDF from Html
Private pdf = PdfDocument.FromFile("encrypted.pdf", "password")
' Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto"
pdf.MetaData.Keywords = "SEO, Friendly"
pdf.MetaData.ModifiedDate = DateTime.Now
' Edit file security settings
' The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption()
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key")
pdf.SecuritySettings.AllowUserAnnotations = False
pdf.SecuritySettings.AllowUserCopyPasteContent = False
pdf.SecuritySettings.AllowUserFormData = False
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights
' Change or set the document encryption password
pdf.Password = "my-password"
pdf.SaveAs("secured.pdf")
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'<br>
SelectPdf:
// set document passwords
doc.Security.OwnerPassword = "test1";
doc.Security.UserPassword = "test2";
//set document permissions
doc.Security.CanAssembleDocument = false;
doc.Security.CanCopyContent = true;
doc.Security.CanEditAnnotations = true;
doc.Security.CanEditContent = true;
doc.Security.CanFillFormFields = true;
doc.Security.CanPrint = true;
// set document passwords
doc.Security.OwnerPassword = "test1";
doc.Security.UserPassword = "test2";
//set document permissions
doc.Security.CanAssembleDocument = false;
doc.Security.CanCopyContent = true;
doc.Security.CanEditAnnotations = true;
doc.Security.CanEditContent = true;
doc.Security.CanFillFormFields = true;
doc.Security.CanPrint = true;
' set document passwords
doc.Security.OwnerPassword = "test1"
doc.Security.UserPassword = "test2"
'set document permissions
doc.Security.CanAssembleDocument = False
doc.Security.CanCopyContent = True
doc.Security.CanEditAnnotations = True
doc.Security.CanEditContent = True
doc.Security.CanFillFormFields = True
doc.Security.CanPrint = True
お探しの際に 暗号化 あなたのPDFドキュメントには、IronPDFおよびSelectPdfの両方に組み込みの暗号化ツールが提供されています。 IronPDFの暗号化機能は非常に充実しており、さまざまなセキュリティ設定を自由に制御できるうえ、使いやすさも兼ね備えています。 SelectPdfの暗号化機能は簡潔かつシンプルで、プロジェクトへの実装が容易です。
PDFファイルにパスワードと権限を追加する方法について詳しくは、IronPDFの役立つ 使い方 ガイド
IronPDF:
using IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact 'are' phrase from all pages
pdf.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
using IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact 'are' phrase from all pages
pdf.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
Imports IronPdf
Private pdf As PdfDocument = PdfDocument.FromFile("novel.pdf")
' Redact 'are' phrase from all pages
pdf.RedactTextOnAllPages("are")
pdf.SaveAs("redacted.pdf")
SelectPdf:
SelectPdfは直接的に墨消しをサポートしていません。
IronPDFは簡潔ながらも強力なPDF 솔루션 제공합니다 編集ツール 指定されたコンテンツをわずか数行のコードで編集できる。 一方、SelectPdfには組み込みの墨消し機能が欠けています。
IronPDF:
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>foo</h1>");
// Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
// Create PdfSignature object
var sig = new PdfSignature(cert);
// Sign PDF document
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>foo</h1>");
// Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
// Create PdfSignature object
var sig = new PdfSignature(cert);
// Sign PDF document
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
Imports IronPdf
Imports IronPdf.Signing
Imports System.Security.Cryptography.X509Certificates
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>foo</h1>")
' Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
Private cert As New X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable)
' Create PdfSignature object
Private sig = New PdfSignature(cert)
' Sign PDF document
pdf.Sign(sig)
pdf.SaveAs("signed.pdf")
SelectPdf:
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// get image path
// the image will be used to display the digital signature over it
string imgFile = Server.MapPath("~/files/logo.png");
// get certificate path
string certFile = Server.MapPath("~/files/selectpdf.pfx");
// define a rendering result object
PdfRenderingResult result;
// create image element from file path
PdfImageElement img = new PdfImageElement(0, 0, imgFile);
result = page.Add(img);
// get the #PKCS12 certificate from file
PdfDigitalCertificatesCollection certificates =
PdfDigitalCertificatesStore.GetCertificates(certFile, "selectpdf");
PdfDigitalCertificate certificate = certificates[0];
// create the digital signature object
PdfDigitalSignatureElement signature =
new PdfDigitalSignatureElement(result.PdfPageLastRectangle, certificate);
signature.Reason = "SelectPdf";
signature.ContactInfo = "SelectPdf";
signature.Location = "SelectPdf";
page.Add(signature);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// get image path
// the image will be used to display the digital signature over it
string imgFile = Server.MapPath("~/files/logo.png");
// get certificate path
string certFile = Server.MapPath("~/files/selectpdf.pfx");
// define a rendering result object
PdfRenderingResult result;
// create image element from file path
PdfImageElement img = new PdfImageElement(0, 0, imgFile);
result = page.Add(img);
// get the #PKCS12 certificate from file
PdfDigitalCertificatesCollection certificates =
PdfDigitalCertificatesStore.GetCertificates(certFile, "selectpdf");
PdfDigitalCertificate certificate = certificates[0];
// create the digital signature object
PdfDigitalSignatureElement signature =
new PdfDigitalSignatureElement(result.PdfPageLastRectangle, certificate);
signature.Reason = "SelectPdf";
signature.ContactInfo = "SelectPdf";
signature.Location = "SelectPdf";
page.Add(signature);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' get image path
' the image will be used to display the digital signature over it
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' get certificate path
Dim certFile As String = Server.MapPath("~/files/selectpdf.pfx")
' define a rendering result object
Dim result As PdfRenderingResult
' create image element from file path
Dim img As New PdfImageElement(0, 0, imgFile)
result = page.Add(img)
' get the #PKCS12 certificate from file
Dim certificates As PdfDigitalCertificatesCollection = PdfDigitalCertificatesStore.GetCertificates(certFile, "selectpdf")
Dim certificate As PdfDigitalCertificate = certificates(0)
' create the digital signature object
Dim signature As New PdfDigitalSignatureElement(result.PdfPageLastRectangle, certificate)
signature.Reason = "SelectPdf"
signature.ContactInfo = "SelectPdf"
signature.Location = "SelectPdf"
page.Add(signature)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
IronPDFを使用して、適用 デジタル署名 PDFファイルへの署名は、そのシンプルで強力なPDF署名ツールを使用することで簡単に行えます。 SelectPdfは、PDFにデジタル署名を適用することもできますが、設定に手間がかかり、手動での操作が多くなります。
IronPDFのデジタル署名ツールの詳細をご覧になりたい場合は、こちらをご覧ください 使い方 このツールに関するガイド
IronPDF:
using IronPdf;
// Stamps a Watermark onto a new or existing PDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/");
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
pdf.SaveAs(@"C:\Path\To\Watermarked.pdf");
using IronPdf;
// Stamps a Watermark onto a new or existing PDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/");
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
pdf.SaveAs(@"C:\Path\To\Watermarked.pdf");
Imports IronPdf
' Stamps a Watermark onto a new or existing PDF
Private renderer = New ChromePdfRenderer()
Private pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/")
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center)
pdf.SaveAs("C:\Path\To\Watermarked.pdf")
SelectPdf:
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(), font);
page.Add(text);
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// watermark all pages - add a template containing an image
// to the bottom right of the page
// the image should repeat on all pdf pages automatically
// the template should be rendered behind the rest of the page elements
PdfTemplate template = doc.AddTemplate(doc.Pages[0].ClientRectangle);
PdfImageElement img = new PdfImageElement(
doc.Pages[0].ClientRectangle.Width - 300,
doc.Pages[0].ClientRectangle.Height - 150, imgFile);
img.Transparency = 50;
template.Background = true;
template.Add(img);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(), font);
page.Add(text);
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// watermark all pages - add a template containing an image
// to the bottom right of the page
// the image should repeat on all pdf pages automatically
// the template should be rendered behind the rest of the page elements
PdfTemplate template = doc.AddTemplate(doc.Pages[0].ClientRectangle);
PdfImageElement img = new PdfImageElement(
doc.Pages[0].ClientRectangle.Width - 300,
doc.Pages[0].ClientRectangle.Height - 150, imgFile);
img.Transparency = 50;
template.Background = true;
template.Add(img);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
' create a new pdf document
Dim doc As New PdfDocument()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 24
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new text element and add it to the page
Dim text As New PdfTextElement(0, 0, Helper.SomeLongText(), font)
page.Add(text)
' get image path
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' watermark all pages - add a template containing an image
' to the bottom right of the page
' the image should repeat on all pdf pages automatically
' the template should be rendered behind the rest of the page elements
Dim template As PdfTemplate = doc.AddTemplate(doc.Pages(0).ClientRectangle)
Dim img As New PdfImageElement(doc.Pages(0).ClientRectangle.Width - 300, doc.Pages(0).ClientRectangle.Height - 150, imgFile)
img.Transparency = 50
template.Background = True
template.Add(img)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
IronPDFの組み込み 透かしツール HTMLとCSSを利用してPDFページに透かしを簡単に適用する方法を提供し、同時にプロセス全体を完全に制御することができます。そのすべてを、わずか数行のコードで行うことができます。 SelectPdfにもPDF透かしツールがあり、これを使用してカスタム透かしをPDFに追加できますが、プロセスが長く、実装が簡単ではないかもしれません。
IronPDF:
using IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create text stamper
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the text stamper
pdf.ApplyStamp(textStamper);
pdf.SaveAs("stampText.pdf");
// Create image stamper
ImageStamper imageStamper = new ImageStamper(new Uri("/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
<br>
using IronPdf;
using IronPdf.Editing;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create text stamper
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the text stamper
pdf.ApplyStamp(textStamper);
pdf.SaveAs("stampText.pdf");
// Create image stamper
ImageStamper imageStamper = new ImageStamper(new Uri("/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
<br>
Imports IronPdf
Imports IronPdf.Editing
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>")
' Create text stamper
Private textStamper As New TextStamper() With {
.Text = "Text Stamper!",
.FontFamily = "Bungee Spice",
.UseGoogleFont = True,
.FontSize = 30,
.IsBold = True,
.IsItalic = True,
.VerticalAlignment = VerticalAlignment.Top
}
' Stamp the text stamper
pdf.ApplyStamp(textStamper)
pdf.SaveAs("stampText.pdf")
' Create image stamper
Dim imageStamper As New ImageStamper(New Uri("/img/svgs/iron-pdf-logo.svg")) With {.VerticalAlignment = VerticalAlignment.Top}
' Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0)
pdf.SaveAs("stampImage.pdf")
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'<br>
SelectPdf:
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(), font);
page.Add(text);
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// stamp all pages - add a template containing an image to the bottom right of
// the page the image should repeat on all pdf pages automatically
PdfTemplate template = doc.AddTemplate(doc.Pages[0].ClientRectangle);
PdfImageElement img = new PdfImageElement(
doc.Pages[0].ClientRectangle.Width - 300,
doc.Pages[0].ClientRectangle.Height - 150, imgFile);
template.Add(img);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(), font);
page.Add(text);
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// stamp all pages - add a template containing an image to the bottom right of
// the page the image should repeat on all pdf pages automatically
PdfTemplate template = doc.AddTemplate(doc.Pages[0].ClientRectangle);
PdfImageElement img = new PdfImageElement(
doc.Pages[0].ClientRectangle.Width - 300,
doc.Pages[0].ClientRectangle.Height - 150, imgFile);
template.Add(img);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
' create a new pdf document
Dim doc As New PdfDocument()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 24
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new text element and add it to the page
Dim text As New PdfTextElement(0, 0, Helper.SomeLongText(), font)
page.Add(text)
' get image path
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' stamp all pages - add a template containing an image to the bottom right of
' the page the image should repeat on all pdf pages automatically
Dim template As PdfTemplate = doc.AddTemplate(doc.Pages(0).ClientRectangle)
Dim img As New PdfImageElement(doc.Pages(0).ClientRectangle.Width - 300, doc.Pages(0).ClientRectangle.Height - 150, imgFile)
template.Add(img)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
IronPDFは、強力なツールを提供しています テキストと画像のスタンピング PDFドキュメントへ。 テキストまたは画像のスタンプを適用する方法はHTMLおよびCSSに似ているため、スタンピングプロセスを完全に制御することができます。 SelectPdfのアプローチはより長く、プロセスに手作業が多く含まれています。
IronPDFのスタンピングツールについて詳しく知りたい場合は、便利な 使い方 ガイド
IronPDF:
using IronPdf;
// Instantiate Renderer
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
// Render from DOCX file
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
// Save the PDF
pdf.SaveAs("pdfFromDocx.pdf");
<br>
using IronPdf;
// Instantiate Renderer
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
// Render from DOCX file
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
// Save the PDF
pdf.SaveAs("pdfFromDocx.pdf");
<br>
Imports IronPdf
' Instantiate Renderer
Private renderer As New DocxToPdfRenderer()
' Render from DOCX file
Private pdf As PdfDocument = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx")
' Save the PDF
pdf.SaveAs("pdfFromDocx.pdf")
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'<br>
SelectPdf:
SelectPdfは直接的なDOCXからPDFへの変換に対応していません。
IronPDFは直接変換をサポートしています DOCXファイルをPDFに変換する. この機能を使用すると、ファイルの品質を損なうことなく、わずか数行でDOCXをPDFに変換できます。 しかし、SelectPdfには、DOCXからPDFへのネイティブサポートがありません。
IronPDFのDOCXからPDFへの変換機能の詳細については、こちらをご覧ください。 使い方 このトピックに関するガイド。
詳細なコード例については、次を参照ください IronPDFの例.
IronPDF ライセンスの購入には異なるレベルと追加機能があります。 開発者は、また、購入することができます アイアンスイート すべてのIronSoftwareの製品にアクセスできることを、2つの価格で提供します。 ライセンスを購入する準備ができていない場合、IronPDF は 無料試用 30日間持続する。
継続的な製品サポート: IronPDFは、$999/年または一度の購入で$1,999の5年間のカバレッジで、継続的な製品更新、セキュリティ機能のアップグレード、エンジニアリングチームからのサポートへのアクセスを提供します。
IronSuite:1,498ドルで、IronPDF、IronOCR、IronWord、IronXL、IronBarcode、IronQR、IronZIP、IronPrint、およびIronWebScraperを含むすべてのIron Software製品にアクセスできます。
SelectPdfは、1年間のメンテナンスプランを含む永久ライセンスを複数提供しています。
IronPDFは、充実したドキュメントとサポートを提供することに優れています。
コミュニティフォーラム: 追加サポートのための積極的なコミュニティ。
定期的な更新: 最新機能とセキュリティパッチを確保するための月次製品アップデート。
詳しくは、IronPDFの幅広い情報をご覧ください。 ドキュメント、そして訪問してください IronSoftware YouTubeチャネル.
Email Support: 技術的およびライセンスに関する問い合わせに対応します。
PDFプロジェクトに適したPDFライブラリを用意することは、PDFを扱う際に不可欠です。 今日は、IronPDFとSelectPdfを使った動作を見て、これら二つのライブラリを詳しく調べました。 SelectPdfは、PDFを操作するための堅実な機能を幅広く提供していますが、多くの場合、それらを実装するのにIronPDFよりも多くの作業が必要になることがあります。
IronPDFは、堅牢なPDF機能を必要とする.NET開発者にとって、汎用性が高く包括的なソリューションとして際立っています。 その広範な機能、最新の .NET フレームワークとの互換性、そして優れたサポートにより、開発者のツールキットに追加するための強力なツールとなります。
9つの .NET API製品 オフィス文書用