Forum How do I...?

How do I use the --license-key flag?

0xhc
Hey there,

Similar to this post (https://www.princexml.com/forum/topic/3012/accept-license-from-stdin) I want to pass the license key via the --license-key flag, which is documented here (https://www.princexml.com/doc/command-line/#general-options). For some reason that flag is not working even though I've removed the <signature> node from my license file (placed in the default location) and I'm using the signature value as the flag value (--license-key=SIGNATUREHERE).

If I run "prince --help" I cannot see that flag. Is this expected? I've also tried to find release notes mentioning that the flag has been removed, but I could not find anything.

Am I doing something wrong? Am I missing something?

My license (after removing the <signature> node looks like this:

<license id="some-id">
<name>SOME_NAME</name>
<vendor>YesLogic</vendor>
<product>Prince</product>
<version>15</version>
<end-user>SOME_USER</end-user>
<date>SOME_DATE</date>
<option id="upgrades">SOME_DATE</option>
</license>


I'm using:
Prince 15.4
build-date: 2024-08-13
build-commit: c73c27a7ab9d659eae7e9e183f297d34395b156e
build-compiler: rotd-2024-02-27

I've tested this on Mac (M3 Pro) and a Linux machine (running Ubuntu). The issue is there in both of them.

Thanks in advance!
mikeday
What is the error you are receiving?
0xhc
Hi Mike, thanks for the quick response.

Prince says the license is not valid. When a document is generated I'm seeing the PrinceXML watermark in the document. Also, see the output of "prince --version --debug --license-key MYLICENSEKEY"

prince: debug: init locking for OpenSSL
prince: debug: loading license: /usr/local/lib/prince/license/license.dat
prince: debug: loading /usr/local/lib/prince/license/license.dat because it is the main resource
prince: loading document: /usr/local/lib/prince/license/license.dat
prince: debug: loaded resource: /usr/local/lib/prince/license/license.dat
prince: debug: loaded resource: type: no
prince: /usr/local/lib/prince/license/license.dat: warning: invalid license
Prince 15.4
Copyright 2002-2023 YesLogic Pty. Ltd.
No license
build-date: 2024-08-13
build-commit: c73c27a7ab9d659eae7e9e183f297d34395b156e
build-compiler: rotd-2024-02-27
build-grade: hlc.par.gc
mikeday
Would you be able to email me (mikeday@yeslogic.com) the modified license file you are using?
0xhc
Hey Mike, sure, I'll send you an email. Thanks!
mikeday
Sorry I see the issue now, the --license-key option requires the signature element to remain in place after the date element, just with its text content removed:

<date>2024-06-01</date>
<signature></signature>

We will need to update the documentation to clarify this.