Converting PDF pages to PNG is a common software processing task. In scenarios where you need to extract certain data from a PDF document, converting document pages to PNG images can simplify the task. Extracted PNG images can be easily embedded into other documents or websites. Displaying PDF content as PNG on websites ensures consistent rendering across different browsers and devices without needing a PDF viewer plugin. This type of integration enhances the visual appeal of the content and allows for a more dynamic use of the information originally contained in the PDF format.
Wordize for .NET can handle even the most complex PDF document layouts, ensuring all pages retain their professional appearance when converted to PNG images.
Key features of PDF to PNG conversion in C#:Ready to enhance your document processing workflow with cutting-edge PDF page rendering technology? Begin transforming PDF documents into high-quality PNG using Wordize for .NET today!
using Wordize.Conversion;
using Wordize.Saving;
var imageStreams = Converter.ConvertToImages("Input.pdf", new ImageSaveOptions(SaveFormat.Png));
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.png");
stream.CopyTo(file);
}
using Wordize.Conversion;
Converter.Convert("Input.pdf", "Output.png");
using Wordize.Conversion;
using Wordize.Saving;
var imageStreams = Converter.ConvertToImages("Input.pdf", new ImageSaveOptions(SaveFormat.Png));
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.png");
stream.CopyTo(file);
}
using Wordize.Conversion;
using Wordize.Saving;
ImageSaveOptions saveOptions = new ImageSaveOptions(saveFormat);
saveOptions.PageLayout = MultiPageLayout.Vertical(10);
Converter.Create()
.From("Input.pdf")
.To("Output.png", saveOptions)
.Execute();