Create Profile without Admin Rights

Post here any questions/suggestions you have about novaPDF SDK or novaPDF OEM.

Create Profile without Admin Rights

Postby mrki » 15 Mar 2016, 18:21

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: 15 Mar 2016, 17:59

Re: Create Profile without Admin Rights

Postby mrki » 05 Apr 2016, 10:48

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!
mrki
 
Posts: 3
Joined: 15 Mar 2016, 17:59

Re: Create Profile without Admin Rights

Postby Softland » 05 Apr 2016, 11:06

Thank you for sharing the solution with the other users!
Softland
 
Posts: 146
Joined: 16 Dec 2009, 12:48
Location: Cluj-Napoca, Romania


Return to Developer Tools



Who is online

Users browsing this forum: No registered users and 1 guest

cron