Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.PDF for .NET 7.0.0의 출시와 함께, 우리는 PDF 문서에서 이미지의 해상도와 위치를 가져오는 유사한 기능을 제공하는 ImagePlacement, ImagePlacementAbsorber 및 ImagePlacementCollection이라는 클래스를 도입했습니다.
다음 코드 스니펫은 Aspose.Drawing 라이브러리와 함께 작동합니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ExtractAndScaleImagesFromPDF()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Images();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "ImagePlacement.pdf"))
{
var abs = new Aspose.Pdf.ImagePlacementAbsorber();
// Load the contents of the first page
document.Pages[1].Accept(abs);
// Iterate through each image placement on the first page
foreach (var imagePlacement in abs.ImagePlacements)
{
// Get image properties
Console.Out.WriteLine("image width: " + imagePlacement.Rectangle.Width);
Console.Out.WriteLine("image height: " + imagePlacement.Rectangle.Height);
Console.Out.WriteLine("image LLX: " + imagePlacement.Rectangle.LLX);
Console.Out.WriteLine("image LLY: " + imagePlacement.Rectangle.LLY);
Console.Out.WriteLine("image horizontal resolution: " + imagePlacement.Resolution.X);
Console.Out.WriteLine("image vertical resolution: " + imagePlacement.Resolution.Y);
}
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.