Class PdfOptions

PdfOptions class

The PDF options.

public class PdfOptions : ImageOptionsBase

Constructors

NameDescription
PdfOptions()The default constructor.

Properties

NameDescription
BufferSizeHint { get; set; }Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
Disposed { get; }Gets a value indicating whether this instance is disposed.
FullFrame { get; set; }Gets or sets a value indicating whether [full frame].
KeepMetadata { get; set; }Gets a value whether to keep original image metadata on export.
MultiPageOptions { get; set; }The multipage options
PageSize { get; set; }Gets or sets the size of the page.
virtual Palette { get; set; }Gets or sets the color palette.
PdfCoreOptions { get; set; }The PDF core options
PdfDocumentInfo { get; set; }Gets or sets metadata for document.
ProgressEventHandler { get; set; }Gets or sets the progress event handler.
virtual ResolutionSettings { get; set; }Gets or sets the resolution settings.
Source { get; set; }Gets or sets the source to create image in.
UseOriginalImageResolution { get; set; }Gets or sets a value indicating to use the original image DPI resolution
VectorRasterizationOptions { get; set; }Gets or sets the vector rasterization options.
virtual XmpData { get; set; }Gets or sets the XMP metadata container.

Methods

NameDescription
virtual Clone()Clones this instance.
Dispose()Disposes the current instance.

Examples

The following example shows how to convert a multipage vector image to PDF format in general way without referencing to a particular image type.

[C#]

string dir = "C:\\aspose.imaging\\net\\misc\\ImagingReleaseQATester\\Tests\\testdata\\2548";
string inputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr");
string outputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr.pdf");

Aspose.Imaging.ImageOptionsBase exportOptions = new Aspose.Imaging.ImageOptions.PdfOptions();

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFilePath))
{
    exportOptions.MultiPageOptions = null;

    // Export only first two pages to the corresponding pages of the output PDF document.
    Aspose.Imaging.IMultipageImage multipageImage = image as Aspose.Imaging.IMultipageImage;
    if (multipageImage != null && (multipageImage.Pages != null && multipageImage.PageCount > 2))
    {
        exportOptions.MultiPageOptions = new Aspose.Imaging.ImageOptions.MultiPageOptions(new Aspose.Imaging.IntRange(0, 2));
    }

    if (image is Aspose.Imaging.VectorImage)
    {
        exportOptions.VectorRasterizationOptions = (Aspose.Imaging.ImageOptions.VectorRasterizationOptions)image.GetDefaultOptions(new object[] { Aspose.Imaging.Color.White, image.Width, image.Height });
        exportOptions.VectorRasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel;
        exportOptions.VectorRasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.None;
    }

    image.Save(outputFilePath, exportOptions);
}

See Also