GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / PdfCreateRights Method
Allows the user to print the document. Set this parameter to true if you want to allow printing, otherwise set it to false.
Allows the user to modify the document. Set this parameter to true if you want to allow editing, otherwise set it to false.
Allows the user to copy or extract text and graphics from the document. Set this parameter to true if you want to allow copying, otherwise set it to false.
Allows the user to add annotations. Set this parameter to true if you want to allow adding annotations, otherwise set it to false.
Allows the user to fill in form fields. Set this parameter to true if you want to allow form filling, otherwise set it to false.

This permission only works with 128-bit encryption.

Enables copying or extracting for use with accessibility features. Set this parameter to true if you want to enable this permission, otherwise set it to false.

This permission only works with 128-bit encryption.

Allows the user to assemble the document. Set this parameter to true if you want to allow assembling, otherwise set it to false.

This permission only works with 128-bit encryption.

Allows high resolution printing of the document. Set this parameter to true if you want to enable this permission, otherwise set it to false.

This permission only works with 128-bit encryption.

Example





In This Topic
PdfCreateRights Method (GdPictureImaging)
In This Topic
Creates a value, which determines access permissions to the various operations within the PDF document according to what you have specified. This value is subsequently used as the Rights parameter when saving the processed image as an encrypted PDF document, for example, using the SaveAsPDF(Int32,String,String,String,String,String,String,PdfEncryption,PdfRight,String,String) method.
Syntax
'Declaration
 
Public Function PdfCreateRights( _
   ByVal CanPrint As Boolean, _
   ByVal CanModify As Boolean, _
   ByVal CanCopy As Boolean, _
   ByVal CanAddNotes As Boolean, _
   ByVal CanFillFields As Boolean, _
   ByVal CanCopyAccess As Boolean, _
   ByVal CanAssemble As Boolean, _
   ByVal CanPrintFull As Boolean _
) As PdfRight
public PdfRight PdfCreateRights( 
   bool CanPrint,
   bool CanModify,
   bool CanCopy,
   bool CanAddNotes,
   bool CanFillFields,
   bool CanCopyAccess,
   bool CanAssemble,
   bool CanPrintFull
)
public function PdfCreateRights( 
    CanPrint: Boolean;
    CanModify: Boolean;
    CanCopy: Boolean;
    CanAddNotes: Boolean;
    CanFillFields: Boolean;
    CanCopyAccess: Boolean;
    CanAssemble: Boolean;
    CanPrintFull: Boolean
): PdfRight; 
public function PdfCreateRights( 
   CanPrint : boolean,
   CanModify : boolean,
   CanCopy : boolean,
   CanAddNotes : boolean,
   CanFillFields : boolean,
   CanCopyAccess : boolean,
   CanAssemble : boolean,
   CanPrintFull : boolean
) : PdfRight;
public: PdfRight PdfCreateRights( 
   bool CanPrint,
   bool CanModify,
   bool CanCopy,
   bool CanAddNotes,
   bool CanFillFields,
   bool CanCopyAccess,
   bool CanAssemble,
   bool CanPrintFull
) 
public:
PdfRight PdfCreateRights( 
   bool CanPrint,
   bool CanModify,
   bool CanCopy,
   bool CanAddNotes,
   bool CanFillFields,
   bool CanCopyAccess,
   bool CanAssemble,
   bool CanPrintFull
) 

Parameters

CanPrint
Allows the user to print the document. Set this parameter to true if you want to allow printing, otherwise set it to false.
CanModify
Allows the user to modify the document. Set this parameter to true if you want to allow editing, otherwise set it to false.
CanCopy
Allows the user to copy or extract text and graphics from the document. Set this parameter to true if you want to allow copying, otherwise set it to false.
CanAddNotes
Allows the user to add annotations. Set this parameter to true if you want to allow adding annotations, otherwise set it to false.
CanFillFields
Allows the user to fill in form fields. Set this parameter to true if you want to allow form filling, otherwise set it to false.

This permission only works with 128-bit encryption.

CanCopyAccess
Enables copying or extracting for use with accessibility features. Set this parameter to true if you want to enable this permission, otherwise set it to false.

This permission only works with 128-bit encryption.

CanAssemble
Allows the user to assemble the document. Set this parameter to true if you want to allow assembling, otherwise set it to false.

This permission only works with 128-bit encryption.

CanPrintFull
Allows high resolution printing of the document. Set this parameter to true if you want to enable this permission, otherwise set it to false.

This permission only works with 128-bit encryption.

Return Value

A combination of members of the PdfRight enumeration. The specified access permissions intended for further use when saving as a PDF document.
Remarks
You can regularly apply the GetStat method to determine if this method has been successful.
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