kdbarrett
12-13-2007, 07:23 AM
There doesn't seem to be a forum for the API specifically, so I thought I'd post the question here. I'm using the demo version of the API as a proof-of-concept for an app I'm working on. I only have a couple of days left so I hope someone can help me soon! :-)
I can create a pdf from a Word doc programmatically, but I can't open it. The error message says that the file may be damaged, so I'm obviously missing something. I'm writing this in C#.Net, adapting from the code in the user manual.
private PrimoAPIDLLClass APPrimo = new PrimoAPIDLLClass();
APPrimo.UserString = "TG0Axxxxxxxxxx";
APPrimo.LicenseKey = "752xxxxxxxxxxxx119510012413123xxxxxxxxxx";
APPrimo.OutputFile = strFileNamePDF;
//**Security Settings
//Type of encryption 40-bit or 128-bit
APPrimo.EncryptionKeyLength = 40;
APPrimo.CanPrint = false;
APPrimo.CanEdit = false;
APPrimo.CanCopy = false;
APPrimo.CanComment = false;
//Passwords for the created PDF
APPrimo.UserPassword = "AnyPassword";
APPrimo.OwnerPassword = "AnyPassword";
//**PDF Quality Settings
//DPI resolution of created PDF
APPrimo.Resolution = 300;
//After all Optional Settings are set call WriteSettings as the final call
//APPrimo.WriteSettings
APPrimo.DebugLogging = true;
APPrimo.CreatePrinter();
After the above, I call the WordApp.PrintOut function to create the pdf. In the sample code, APPrimo.WriteSettings is commented out and it doesn't seem to exist in C#.
Thanks for your help!
I can create a pdf from a Word doc programmatically, but I can't open it. The error message says that the file may be damaged, so I'm obviously missing something. I'm writing this in C#.Net, adapting from the code in the user manual.
private PrimoAPIDLLClass APPrimo = new PrimoAPIDLLClass();
APPrimo.UserString = "TG0Axxxxxxxxxx";
APPrimo.LicenseKey = "752xxxxxxxxxxxx119510012413123xxxxxxxxxx";
APPrimo.OutputFile = strFileNamePDF;
//**Security Settings
//Type of encryption 40-bit or 128-bit
APPrimo.EncryptionKeyLength = 40;
APPrimo.CanPrint = false;
APPrimo.CanEdit = false;
APPrimo.CanCopy = false;
APPrimo.CanComment = false;
//Passwords for the created PDF
APPrimo.UserPassword = "AnyPassword";
APPrimo.OwnerPassword = "AnyPassword";
//**PDF Quality Settings
//DPI resolution of created PDF
APPrimo.Resolution = 300;
//After all Optional Settings are set call WriteSettings as the final call
//APPrimo.WriteSettings
APPrimo.DebugLogging = true;
APPrimo.CreatePrinter();
After the above, I call the WordApp.PrintOut function to create the pdf. In the sample code, APPrimo.WriteSettings is commented out and it doesn't seem to exist in C#.
Thanks for your help!