itext7 - Cannot get trial license to load for itext 7 .2.0 - itext

I trying explore pdfoffice functionality of itext 7. have obtained 30 day trial license. when call licensekey.loadlicensefile(path-to-key-file), returns without errors,following error:
licensekeyexception license file not loaded.

Related

IText7 License is not working for SharePoint

LicenseKey.LoadLicenseFile is not working for sharepoint project.
When I create a console tool and add itext.licesekey.dll manually, the pdf file is generated without license. But if I add it by PM command Install-Package itext7.licensekey, it works correctly.
Do you have any idea why this could happen?
Thanks in advance,
Toan
There are 2 possible reasons why this is happening:
You're using the wrong version of the license key library which is used for checking your license file.
For iText 5, that library is called itextsharp.licensekey.dll and has a root namespace of iTextSharp. For iText 7, on the other hand, it is called itext.licensekey.dll and has a root namespace of itext.
The NuGet package at https://www.nuget.org/packages/itext7.licensekey, which you installed with PM command Install-Package itext7.licensekey, is the correct license key library for your iText 7 license.
Your manually added license key library is correct, but you didn't add it in the right way so that your project knows where to find it. That is the convenience of the NuGet Package Manager: it makes sure that your libraries are added in the right way. I have never used .NET myself so I can't go into details, but to my understanding, NuGet is sort of like the Maven of the .NET world, as far as dependency management is concerned.
By the way, because you are an iText customer with a valid license key, you probably also have a support contract, and you should ask questions about your license in the iText JIRA. I can't find your login based on your name, every customer can register up to 3 contacts that are eligible for support. Please check with the person in your company who purchased the iText license.
Or you are using a time limited trial license, in which case you can also contact iText Sales for questions about the license.
I have decompiled the itext dlls and figure out in iText.Kernel.Version class, method GetInstance:
string str = "iText.License.LicenseKey, itext.licensekey";
string str1 = "GetLicenseeInfo";
Type type = Type.GetType(str);
if (type == null)
{
Version.version.AddAGPLPostfix(null);
}
The variable type was null.
Please check here for more information how to get dll from GAC
The solution should look like that
I guess the correct string should be like this
string str = "iText.License.LicenseKey, itext.licensekey, Version=2.0.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca";

Zend Framework with Handwritten Font

I am trying to use the Amatic Font from Google in my PDF File but it gives me an Error like below. Could that be because the Font Type? I have tested with Open Sans and it is working.
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught exception
'Zend_Pdf_Exception' with message 'Unable to read version 4 table' in
/var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/FileParser/Font/OpenType.php:555\nStack
trace:\n#0
/var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/FileParser/Font/OpenType.php(121):
Zend_Pdf_FileParser_Font_OpenType->_parseOs2Table()\n#1
/var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/FileParser/Font/OpenType/TrueType.php(83):
Zend_Pdf_FileParser_Font_OpenType->parse()\n#2
/var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/Font.php(701):
Zend_Pdf_FileParser_Font_OpenType_TrueType->parse()\n#3
/var/www/vhosts/httpdocs/main/zend/library/Zend/Pdf/Font.php(615):
Zend_Pdf_Font::_extractTrueTypeFont(Object(Zend_Pdf_FileParserDataSource_File),
0)\n#4 /var/www/vhosts/httpdocs/main/zend/invoice.php(27):
Zend_Pdf_Font::fontWithPath('/var/www/vhosts...')\n#5 {main}\n\nNext
exception 'Zend_Pdf_Exception' wi...\n'
I am using this Script for my tests https://github.com/phpmasterdotcom/GeneratingInvoicesWithZendPdf/blob/master/public/invoice.php
What's happening is this: The Zend Framework code in OpenType.php explicitly checks the OS/2 table version of the font. Is it higher than 3, an exception is thrown. Your font has an OS/2 table version of 4 (which is the fifth version, there are at least 6 versions as far as I know).
Unfortunately, recent versions of the ZendPdf module (like here on GitHub) still don't seem to support version 4 or higher. So apart from looking for another pdf generator - that does support version 4 - I fear there's no clean solution.
You could try editing the framework code, but of course that's a bit shady. As an alternative, apparently it should be able to change that version and regenerate the font. See this post on the Tex forum (the post AFTER the accepted answer). If you choose that path, probably you'll find better guidance on that forum.
Sorry I can't offer a better solution, but maybe it helps you understanding what's going on.

Invalid trailer in pdf java itext 5.4.3

My requirement is to add the time stamp in the bottom of the PDF. I'm using itext 5.4.3 version to edit the PDF and able to add the time-stamp successfully. But the process is throwing java.lang.ArrayIndexOutOfBoundsException exception for some PDF.. Attaching the exception stack trace below.
at com.itextpdf.text.pdf.PdfEncryption.createInfoId(PdfEncryption.java:558)
at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:383)
at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:337)
at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:206)
I did the analysis and found this issue is happening due to bad trailer exist in pdf,itext is expecting 16 bit trailer data whereas my pdf is having only 4 bit or some times 10 bit. Attaching the trailer information below.
Valid Trailer:
/ID AA8280F47FC1BF4DCD5C88E6A493092D
Invalid Trailer:
/ID B2DE387A
We have asked vendor to re-scan the PDF again but looks like most of the PDF is having the similar trailer. Is there anyway to edit the PDF using itext which is having invalid trailer? Please help.
Any updated version will fix the issue?
This is reproducible with 5.4.3, but not with the current version, 5.5.7.
This is probably the commit that fixed it: e28f688033
(This fix seems to be a bit overkill, because it's creating new IDs whenever the existing one aren't 16 bytes, which isn't a requirement.)

is PdfPKCS7.loadCacertsKeyStore() deprecated

Is the PdfPKCS7.loadCacertsKeyStore() deprecated in the last iText version 5.5.6?
It seems yes, so my question is how to verify the authenticity of the certificate and the certificate chain without using load then apply PdfPKCS7.verifyCertificates like we did before?
Any new sample code?
Best regards
Jamil
You ask whether PdfPKCS7.loadCacertsKeyStore() is deprecated in the last iText version 5.5.6. Actually that method has been removed already three years ago in version 5.3.0; back then the whole iText signature API had been overhauled.
For a documentation on the current iText signature API read the white paper Digital Signatures for PDF Documents.
This white paper also contains many code samples, e.g. in section 5.3 Validating the certificates of a signature you can find Code sample 5.5: Verifying certificates:
Certificate[] certs = pkcs7.getSignCertificateChain();
Calendar cal = pkcs7.getSignDate();
List<VerificationException> errors =
CertificateVerification.verifyCertificates(certs, ks, cal);
if (errors.size() == 0)
System.out.println("Certificates verified against the KeyStore");
else
System.out.println(errors);

Workflow error Purchase requisition

I have created a purchase requisition which has to go through a workflow for approval.It gives me the following when i click on it .
Error executing code: SysWorkflowFormControls (object) has no valid runable code in method 'getActionBarContentForOriginator'.
(C)\Classes\SysWorkflowFormControls\getActionBarContentForOriginator
(C)\Classes\SysWorkflowFormControls\showOriginatorContent - line 19
(C)\Classes\SysWorkflowFormControls\updateControls - line 76
(C)\Classes\SysSetupFormRun\updateWorkflowControls - line 4
(C)\Classes\Info\formNotify - line 30
(C)\Classes\FormRun\selectControl
You have to install your ms dax 2009 sp1 to get rid of that error.
In case you dont want to install SPI to get rid of this error,
you could simply remove the datetime2str method.
For eg,
you could write “datetime2str(lastActionDateTime, DateFlags::FormatAll)” as “lastActionDateTime”.
Make sure you do these changes in three places in SysWorkflowFormControls Class.