Exception says that I am using evaluation mode

I have the following code fragment to read an xfa form and create a pdf image, which I copied from your Web site:

string inFile = sourceFi.FullName;
string outFile = destFile;
Aspose.Pdf.Document pd = new Aspose.Pdf.Document(inFile);
pd.Form.Type = FormType.Standard;
JpegDevice jpegDevice = new JpegDevice(new Resolution(96));
using (FileStream stream = new FileStream(outFile, FileMode.Create, FileAccess.Write))
{
jpegDevice.Process(pd.Pages[1], stream);
}

On execution of "pd.Form.Type = FormType.Standard;" I get the following exception: "At most 4 text fragments can be added in evaluation mode." My license was just renewed 12/9/2013 and the latest Aspose.Pdf.lic file is in the same directory as the .cs source files.

Am I not using the license correctly? Is the "evaluation mode" description incorrect? Can you explain what is happening?

Thank you,
Jeff Cooper


Hi Jeff,


Thanks for your inquiry. Can you please double check that license is implemented correctly? you can also refer licensing documentation for the purpose. If issue persist then please share your complete sample code here and share your license file as suggested here? So we will test the scenario and will provide you more information accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hi Jeff,

Thank you for sharing the sample project and license. I am afraid I am unable to find any license implementation in the code. You need to set the license before instantiating any Aspose.Pdf object and you only need to set the license once per application domain. You can move the set license call to the start-up method of your application which is only executed once.

Please implement the license in the main method of your project as follows. It will solve the issue.

static void Main(string[] args)
{
    Aspose.Pdf.License license = new Aspose.Pdf.License();
    license.SetLicense("Aspose.Pdf.lic");

    FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
    if (folderBrowserDialog1.ShowDialog() != DialogResult.OK) return;
    sourceDir = new DirectoryInfo(folderBrowserDialog1.SelectedPath);

    FolderBrowserDialog folderBrowserDialog2 = new FolderBrowserDialog();
    if (folderBrowserDialog2.ShowDialog() != DialogResult.OK) return;
    destDir = new DirectoryInfo(folderBrowserDialog2.SelectedPath);

    .........
    .........
}

please feel free to contact us for any further assistance,

Best Regards,