Moderators:TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
I got the code below online, but I am having difficulties implementing it using the PDF-XChange Editor SDK.
It seems I need to use an active X object with a Windows From to get the IPXV_Document and IPXV_Inst.
Is there a way I can achieve this using only the PDF-XChange Editor SDK from a console application.
Inst.AddPluginFromFile("D:\\PDFAPlugin.pvp");
//C#
private void SaveDocument(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst)
{
//Performing save to the same file
Doc.Save();
//Performing save to the specified file without the progress bar
PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS");
PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestFile.pdf"); //Converting string to name
Doc.Save(destPath, (int)PDFXEdit.PXV_DocSaveFlags.PXV_DocSave_NoProgress);
//Saving document as pdfa (for this the PDFA plugin should be registered)
PDFXEdit.IPXV_ExportConverter cnv = null;
for (uint i = 0; i < pdfCtl.Inst.ExportConvertersCount; i++)
{
if (pdfCtl.Inst.ExportConverter[i].ID == "conv.exp.pdfa")
cnv = pdfCtl.Inst.ExportConverter[i];
}
if (cnv != null)
{
PDFXEdit.ICab cab = pdfCtl.Inst.GetFormatConverterParams(false, "conv.exp.pdfa");
pdfCtl.Doc.Save(destPath, 0, null, cnv, cab);
}
}
If you are not using the IPXV_Control, then you won't have a IPXV_Document available at all. You should use only the IPXV_Inst in the console project. What you have is the IPXC_Document that should be opened by using the IPXC_Inst (that can be obtained from the IPXV_Inst by using the GetExtension() method). Once you have it, you can prepare the ExportConverter and then do:
Hi Alex
Thank you for the reply, I have applied the changes you suggested but no success.
Below is the code i am using
It throws a com exception on the pxvInst.AddPluginFromFile().
Method.
The exceptions are.
"Error HRESULT E_FAIL has been returned from a call to a COM component." for the AddPluginFromFile()
The IAUX_Inst::FormatHRESULT formatted message = "Error [System]: Unspecified error."
Hi Alex
Thanks you for help.
I am almost there now, but I have 1 more questions.
1. I suppress the conversion report pop up box that shows up after each file is converted to PDF/A-1b, this is because we would like to run this operation as a
batch job using a windows service. Is there a way to redirect the error and fixes output in the image below to a string that I can log in my process so that my users
will know why some conversions failed.
Thank you for the reply.
I have successfully suppress the report popup, my question was is there a way to redirect the output the report shows to a string in my code.
I will like to show my Users the Errors and fixes so that they can know which files have issues in them and why the conversion failed.
Thank you for your help, I have another issue, when I try to validate the PDFA/-1b files produces by your trial version,
I get an error message saying transparent images are not allowed in a PDF/A-1b file.
I wanted to confirm if it was as a result of the trial stamp you put on the files, because I do not get this error with PDF/A-2b.
Below are the error messages I get: Using Adobe Acrobat
Using Vera PDF
A Group object with an S key with a value of Transparency shall not be included in a form XObject.
A Group object with an S key with a value of Transparency shall not be included in a page dictionary
This is what you should do (if you have bought a copy of End User Editor of course). Save you document as PDF\A with needed settings with and without the license key and compare the Acrobat validation behavior. Then we will know whether it's our watermark or not.
Hi Alex
We are looking into getting the license.
I have one more issue though.
The conversions go through successfully, but my process does not exit with exit code 0, instead I get the message below.
Aquaforest.Pdfa.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
The weird issue is that this crash happens when i am exiting the process.
Maybe i am not cleaning up the objects and resources.
Hi Alex
I am having the same issue I had in new enviroments.
The conversions go through successfully, but my process does not exit with exit code 0, instead I get the message below.
Aquaforest.Pdfa.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
The weird issue is that this crash happens when i am exiting the process.
Maybe i am not cleaning up the objects and resources.