GdPicture.NET.14 (COM - ActiveX)~GdPicture14_namespace / GdPicture.NET.14 (COM - ActiveX)~GdPicture14.GdPictureImaging / SaveAsPDF_2 Method
GdPicture image identifier.
The complete PDF file path to save a GdPicture image. Can be an empty string. If empty, prompts the user to select a file. You can subsequently use the GetLastPath() method to retrieve the path of the selected file.
The title of the PDF.
The PDF Author.
The PDF Subject.
The PDF Keywords.
The name of the application which creates the PDF.
A member of the PdfEncryption enumeration. Note: AES 256 encyption is not yet available.
A value returned by the PdfCreateRights method.
The user password for the PDF. Can be an empty string.
The owner password for the PDF. Can be an empty string.
Example





In This Topic
    SaveAsPDF_2 Method (GdPictureImaging)
    In This Topic
    Saves a GdPicture image as single page pdf with encryption.
    Syntax
    'Declaration
     
    
    Public Function SaveAsPDF_2( _
       ByVal ImageID As Integer, _
       ByVal FilePath As String, _
       ByVal Title As String, _
       ByVal Author As String, _
       ByVal Subject As String, _
       ByVal Keywords As String, _
       ByVal Creator As String, _
       ByVal Encryption As PdfEncryption, _
       ByVal Rights As PdfRight, _
       ByVal UserPassword As String, _
       ByVal OwnerPassword As String _
    ) As GdPictureStatus
    public GdPictureStatus SaveAsPDF_2( 
       int ImageID,
       string FilePath,
       string Title,
       string Author,
       string Subject,
       string Keywords,
       string Creator,
       PdfEncryption Encryption,
       PdfRight Rights,
       string UserPassword,
       string OwnerPassword
    )
    public function SaveAsPDF_2( 
        ImageID: Integer;
        FilePath: String;
        Title: String;
        Author: String;
        Subject: String;
        Keywords: String;
        Creator: String;
        Encryption: PdfEncryption;
        Rights: PdfRight;
        UserPassword: String;
        OwnerPassword: String
    ): GdPictureStatus; 
    public function SaveAsPDF_2( 
       ImageID : int,
       FilePath : String,
       Title : String,
       Author : String,
       Subject : String,
       Keywords : String,
       Creator : String,
       Encryption : PdfEncryption,
       Rights : PdfRight,
       UserPassword : String,
       OwnerPassword : String
    ) : GdPictureStatus;
    public: GdPictureStatus SaveAsPDF_2( 
       int ImageID,
       string* FilePath,
       string* Title,
       string* Author,
       string* Subject,
       string* Keywords,
       string* Creator,
       PdfEncryption Encryption,
       PdfRight Rights,
       string* UserPassword,
       string* OwnerPassword
    ) 
    public:
    GdPictureStatus SaveAsPDF_2( 
       int ImageID,
       String^ FilePath,
       String^ Title,
       String^ Author,
       String^ Subject,
       String^ Keywords,
       String^ Creator,
       PdfEncryption Encryption,
       PdfRight Rights,
       String^ UserPassword,
       String^ OwnerPassword
    ) 

    Parameters

    ImageID
    GdPicture image identifier.
    FilePath
    The complete PDF file path to save a GdPicture image. Can be an empty string. If empty, prompts the user to select a file. You can subsequently use the GetLastPath() method to retrieve the path of the selected file.
    Title
    The title of the PDF.
    Author
    The PDF Author.
    Subject
    The PDF Subject.
    Keywords
    The PDF Keywords.
    Creator
    The name of the application which creates the PDF.
    Encryption
    A member of the PdfEncryption enumeration. Note: AES 256 encyption is not yet available.
    Rights
    A value returned by the PdfCreateRights method.
    UserPassword
    The user password for the PDF. Can be an empty string.
    OwnerPassword
    The owner password for the PDF. Can be an empty string.

    Return Value

    A member of the GdPictureStatus enumeration.
    Example
    Saving the image as a PDF document specifying document properties and pdf rights.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
        if (gdpictureImaging.GetStat() == GdPictureStatus.OK)
        {
            // Get the file path of the loaded image file.
            string filePath = gdpictureImaging.GetLastPath();
            string pdfPath = System.IO.Path.ChangeExtension(filePath, ".pdf");
     
            // Get the current version of the GdPicture.NET toolkit.
            string version = (gdpictureImaging.GetVersion()).ToString();
            version = version.Insert(version.IndexOf('.') + 2, ".");
            
            // Create pdf rights for saving.
            PdfRight pdfRights = gdpictureImaging.PdfCreateRights(true, false, true, true, false, false, false, true);
            
            // Define the document properties when saving, for example, the current version of the GdPicture.NET toolkit and the pdf rights.
            gdpictureImaging.SaveAsPDF(imageID, filepath, "Saving image as PDF", "GdPicture ver." + version.ToString(), "For test", "image, pdf", "Orpalis", PdfEncryption.PdfEncryption256BitAES, pdfRights, "userpassw", "ownerpassw");
     
            gdpictureImaging.ReleaseGdPictureImage(imageID);
        }
        else
            MessageBox.Show("An image can't be created.\nError: " + gdpictureImaging.GetStat().ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
    See Also

    Reference

    GdPicture.NET.14 (COM - ActiveX)~GdPicture14.GdPictureImaging
    GdPictureImaging Members