Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About argument from virtual printer. #1

Closed
yui0821 opened this issue Mar 17, 2023 · 4 comments
Closed

About argument from virtual printer. #1

yui0821 opened this issue Mar 17, 2023 · 4 comments

Comments

@yui0821
Copy link

yui0821 commented Mar 17, 2023

I'd like to ask about this following contents on your website .

static void Main(string[] args)
{
    var settings = new SettingFolder();
    settings.Load();
    settings.Set(args);
    using (var facade = new Facade(settings)) facade.Invoke();
}

setting.Set(args);
Could you tell me the structure of this args?

For example
args[0]:DocumentName,
args[1]:SourceName
...

@clown
Copy link
Member

clown commented Mar 22, 2023

The command line for executing the user program is as follows:

UserProgram.exe
    -DocumentName  DOCUMENT_NAME
    -InputFile  C:\ProgramData\CubeSoft\CubeVP\PSTF012.tmp
    -Digest  SHA256_HASH
    -UserName  USER_NAME
    -MachineName  MACHINE_NAME
    -DeleteOnClose
    -Exec  Path\To\UserProgram.exe

Therefore, args[0] is "-DocumentName", args[1] is "DOCUMENT_NAME", args[2] is "-InputFile", ..., and so on.
Note that this order may be changed in future versions, so please do not parse it completely fixed. (When parsing, use the "-" option base.)

Here is a description of each argument:

  • DocumentName
    An application executes a print command by specifying a value called the "document name". This argument passes the specified document name to the user program.
  • InputFile
    This represents the path of the temporary file where the virtual printer saves the print data (PostScript). The temporary file is saved in the folder specified as the working folder (Temp) when the virtual printer is installed.
  • Digest
    This represents the result of calculating the SHA-256 hash value for the content of the temporary file. This value is used to detect corruption or tampering of the print data.
    Example: 84e72201691f3869287ec95923c9b2b102f188e758d467d66b7d77690dc61048
  • UserName
    This represents the username when the print command was executed.
  • MachineName
    This represents the name of the terminal where the print command was executed.
  • DeleteOnClose
    This argument tells the virtual printer to delete the file specified in InputFile. The virtual printer exits with the generated temporary file in its current state. Therefore, any post-processing such as deleting the temporary file is the responsibility of the user program.
  • Exec
    This specifies the path to the user program itself. This argument is used by the program CubeProxy.exe, which switches from the SYSTEM account to the logged-on user account. Therefore, if the user program is executed directly without going through CubeProxy.exe, Exec may not be specified.

@yui0821
Copy link
Author

yui0821 commented Mar 22, 2023

Thank you for your response.

I want to convert Excel(.xlsx) to PDF using this program, but would it be difficult to convert?

@clown
Copy link
Member

clown commented Mar 22, 2023

Yes. Since the CubeVP (CubePDF SDK) itself is a PostScript to PDF conversion program, it must be converted to PostScript format once in order to use the program. Since this is currently handled by the virtual printer part, it is difficult to convert directly from Excel to PDF.

@yui0821
Copy link
Author

yui0821 commented Mar 22, 2023

OK. I understand.
Thank you for your response.

@yui0821 yui0821 closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants