Create Profile without Admin Rights

Post here any questions/suggestions you have about novaPDF SDK or novaPDF OEM.
Post Reply
mrki
Posts: 3
Joined: Tue Mar 15, 2016 3:59 pm

Create Profile without Admin Rights

Post by mrki »

Hi,

I am using novaPDf SDK version 7.6 and I am trying to create a Profile programatically. Good thing is that it works, but only if application is started with Admin rights. Problem is that we don't want to require user admin rights for our application...Is it possible to create a profile and set it to active without admin rights?

I am trying like this to create a profile and set it to active:
-------------------------------------------------------------------
novaOptions.StartUpdateProfiles();

var newProfileName = "tmp";
newProfileName += DateTime.Now.ToString("o");
newProfileName += Path.GetRandomFileName();

novaOptions.AddProfile(newProfileName, 1);

novaOptions.SetActiveProfile(newProfileName, 1);

// setting some options to the active profle... such as folder and filename
// HIDE SAVE-AS DIALOG
novaOptions.SetOptionLong2("Prompt Save Dialog", 0, newProfileName, 1);

//in case you do not wish to show a save as dialog, set the folder and the file name to be used
novaOptions.SetOptionString2("Save Folder", @"C:\", newProfileName, 1);
//set a macro for the file name
novaOptions.SetOptionString2("Save File", "myFile.pdf", newProfileName, 1);
//in case a file with the same name exists in the selected folder, choose what to do
novaOptions.SetOptionLong2("File Conflict Strategy", 3, newProfileName, 1);

novaOptions.EndUpdateProfiles();

// reading out active profile => with admin rights: ok, without admin rights: not set to newly created profile
string activeProfile;
int isPublic;
novaOptions.GetActiveProfile(out activeProfile, out isPublic);
-------------------------------------------------------------------

Thank you in advance!
Best regards!

mrki
Posts: 3
Joined: Tue Mar 15, 2016 3:59 pm

Re: Create Profile without Admin Rights

Post by mrki »

Hi,

found a workaround for this problem:
- uninstall printer
- remove .nvp file from "c:\Windows\System32\spool\drivers\x64\3\" location
- install printer again (with new printer name if desired)

Problem was the .nvp file which gets reduced access rights if printer name is changes manually.

Best regards!

Lorant (Softland)
Posts: 177
Joined: Wed Dec 16, 2009 10:48 am

Re: Create Profile without Admin Rights

Post by Lorant (Softland) »

Thank you for sharing the solution with the other users!

Post Reply