Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
배경 이미지는 문서에 워터마크 또는 기타 미세한 디자인을 추가하는 데 사용할 수 있습니다. Aspose.PDF for .NET에서 각 PDF 문서는 페이지 모음이며 각 페이지는 아티팩트 모음을 포함합니다. BackgroundArtifact 클래스를 사용하여 페이지 객체에 배경 이미지를 추가할 수 있습니다.
다음 코드 스니펫은 Aspose.PDF.Drawing 라이브러리와 함께 작동합니다.
다음 코드 스니펫은 C#을 사용하여 BackgroundArtifact 객체로 PDF 페이지에 배경 이미지를 추가하는 방법을 보여줍니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void AddBackgroundToPdf()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Pages();
// Create PDF document
using (var document = new Aspose.Pdf.Document())
{
// Image for background artifact object
using (var image = File.OpenRead(dataDir + "aspose-total-for-net.jpg"))
{
// Add page
Page page = document.Pages.Add();
// Create Background Artifact object
var background = new Aspose.Pdf.BackgroundArtifact();
// Specify the image for background artifact object
background.BackgroundImage = image;
// Add background artifact to artifacts collection of page
page.Artifacts.Add(background);
// Save PDF document
document.Save(dataDir + "ImageAsBackground_out.pdf");
}
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.