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.
virtual DefaultReplacementFont { get; set; }Gets or sets the default replacement font (font that will be used to draw text when exporting to raster, if existing layer font in PSD file is not presented in system). To take proper name of default font can be used next code snippet: System.Drawing.Text.InstalledFontCollection col = new System.Drawing.Text.InstalledFontCollection(); System.Drawing.FontFamily[] families = col.Families; string defaultFontName = families[0].Name; PsdLoadOptions psdLoadOptions = new PsdLoadOptions() { DefaultReplacementFont = defaultFontName });
Disposed { get; }Gets a value indicating whether this instance is disposed.
FullFrame { get; set; }Gets or sets a value indicating whether [full frame].
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.
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 demonstrates how you can export Adobe Illustrator files to PDF format in Aspose.PSD

[C#]

string sourceFilePath = "rect2_color.ai";
string outputFilePath = "rect2_color.ai_output.pdf";
using (AiImage image = (AiImage)Image.Load(sourceFilePath))
{
    image.Save(outputFilePath, new PdfOptions());
}

The following example demonstrates that AsposePSD supports the PSB files exporting to a PSD format.

[C#]

// Support saving PSB as PDF
string sourceFileName = "sample.psb";
string outFileName = "sample.pdf";

using (PsdImage image = (PsdImage)Image.Load(sourceFileName))
{
    image.Save(outFileName, new PdfOptions());
}

The following code saving PsdImage as PDF document with selectable text.

[C#]

// Saving PSD into PDF does not provide selectable text
string sourceFileName = "text.psd";
string outFileName = "text.pdf";

using (PsdImage image = (PsdImage)Image.Load(sourceFileName))
{
    image.Save(outFileName, new PdfOptions());
}

The following example demonstrates the support of exporting PsdImage to Pdf format.

[C#]

string[] sourcesFiles = new string[]
{
    @"1.psd",
    @"little.psb",
    @"psb3.psb",
    @"inRgb16.psd",
    @"ALotOfElementTypes.psd",
    @"ColorOverlayAndShadowAndMask.psd",
    @"ThreeRegularLayersSemiTransparent.psd"
};
for (int i = 0; i < sourcesFiles.Length; i++)
{
    string sourceFileName = sourcesFiles[i];
    using (PsdImage image = (PsdImage)Image.Load(sourceFileName))
    {
        string outFileName = "PsdToPdf" + i + ".pdf";
        image.Save(outFileName, new PdfOptions());
    }
}

See Also