Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
PdfPageEditor クラスは Aspose.Pdf.Facades namespace 内に存在し、個々のページまたは複数のページのページサイズを一度に変更するために使用できる PageSize プロパティを含んでいます。 Pages プロパティを使用して、新しいページサイズを適用するページの番号を指定することができます。 PageSize クラスは、そのメンバーとしてさまざまなページサイズのリストを保持しています。このクラスのいずれかのメンバーは、PdfPageEditor クラスの PageSize プロパティに割り当てることができます。 GetPageSize メソッドを使用して該当するページ番号を渡すことで、任意のページのページサイズを取得することもできます。
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ChangePdfPageSize()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Create PdfPageEditor object
using (var pdfPageEditor = new Aspose.Pdf.Facades.PdfPageEditor())
{
// Bind PDF document
pdfPageEditor.BindPdf(dataDir + "FilledForm.pdf");
// Change page size of the selected pages
pdfPageEditor.ProcessPages = new[] { 1 };
// Select a predefined page size (LETTER) and assign it
pdfPageEditor.PageSize = Aspose.Pdf.PageSize.PageLetter;
// Save the file with the updated page size
pdfPageEditor.Save(dataDir + "ChangePageSizes_out.pdf");
// Get and display the page size assigned
pdfPageEditor.BindPdf(dataDir + "FilledForm.pdf");
var pageSize = pdfPageEditor.GetPageSize(1);
Console.WriteLine($"Width: {pageSize.Width}, Height: {pageSize.Height}");
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.