Page 1 of 1

Convert procedure hangs up.

Posted: Wed Apr 28, 2021 8:12 am
by baumunk
Code:

Code: Select all

void Init()
        {
            if (Inst != null) return;
            Inst = new PDFXEdit.PXV_Inst();
            Inst.Init(null, licKeyEdit, (IString)null, (IString)null, (IString)null);
            Inst.StartLoadingPlugins();
            Inst.AddPluginFromFile($@"{plugInLoadPath}\ConvertPDF.pvp");
            Inst.AddPluginFromFile($@"{plugInLoadPath}\PDFAPlugin.pvp");
            Inst.FinishLoadingPlugins();
            
        }

        static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        private void Convert_toPDFA(PDFXEdit.PXV_Inst Inst)
        {
            var quelle = @"C:\nora\22.pdf";
            var ziel = @"C:\NoRA\22_pdfa.pdf";
            if (!File.Exists(quelle))              return;
            if (File.Exists(ziel)) File.Delete(ziel);
            try
            {
                PDFXEdit.IPXV_ExportConverter cnv = null;
                for (uint i = 0; i < Inst.ExportConvertersCount; i++)
                {
                    if (Inst.ExportConverter[i].ID != "conv.exp.pdfa") continue;
                    cnv = Inst.ExportConverter[i];
                    break;
                }

                if (cnv == null)
                {
                    
                    return;
                }

                var cab = Inst.GetFormatConverterParams(false, "conv.exp.pdfa");
                var Format = PDFAFormat.PDFA_1B;
                PDFXEdit.ICabNode convParamsRoot = cab.Root;
                var format = Format.ToString();
                var z = format.Substring(format.IndexOf('_') + 1, 2);
                int partIndex;
                int conformanceIndex;
                switch (z[0])
                {
                    case '1':
                        partIndex = 1;
                        break;
                    case '3':
                        partIndex = 3;
                        break;
                    default:
                        partIndex = 2;
                        break;
                }

                switch (z[1])
                {
                    case 'A':
                        conformanceIndex = 0;
                        break;
                    case 'U':
                        conformanceIndex = 2;
                        break;
                    default:
                        conformanceIndex = 1;
                        break;
                }

                convParamsRoot.SetInt("Part", partIndex);
                convParamsRoot.SetInt("Conformance", conformanceIndex);
                convParamsRoot.SetInt("ShowReport", 0);
                convParamsRoot.SetString("ErrorMessage", "true");
                IAFS_Inst fsInst = Inst.GetExtension("AFS");
                var destPath = fsInst.DefaultFileSys.StringToName(ziel);
                const int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_CreateAlways |
                                                 AFS_OpenFileFlags.AFS_OpenFile_Read |
                                                 AFS_OpenFileFlags.AFS_OpenFile_Write |
                                                 AFS_OpenFileFlags.AFS_OpenFile_FullCache);
                var destFile = fsInst.DefaultFileSys.OpenFile(destPath, openFileFlags);
                IPXC_Inst docInst = (PXC_Inst)Inst.GetExtension("PXC");
                var srcDoc = docInst.OpenDocumentFromFile(quelle, null);
                try
                {
                    log.Info("Convert 1");
                    cnv.Convert(Inst, srcDoc, destFile, 0, cab);//->No return !!!!
                    log.Info("Convert 2");-> 
                }
                catch (Exception exp)
                {
                    Inst.ClearHistory(true);
                    destFile.Close();
                    srcDoc.Close();
                }
                Inst.ClearHistory(true);
                destFile.Close();
                srcDoc.Close();
            }
            catch (Exception exp)
            {
                MessageBox.Show($"{exp.Message}\r\n{exp.StackTrace}");
            }
        }
I can provide a test project.
With many PDF it runs, but with some it hangs completely.
At most confidential but not here in forum.

PDF file itself, can not provide so not so (is customer file).

I urgently need your help!!!

Re: Convert procedure hangs up.

Posted: Wed Apr 28, 2021 9:44 am
by baumunk
Update
If application x64 it works.
If application x86 does not work !!!

Re: Convert procedure hangs up.

Posted: Wed Apr 28, 2021 10:51 am
by Sasha - Tracker Dev Team
Hello baumunk,

What SDK version are you using?

Cheers,
Alex

Re: Convert procedure hangs up.

Posted: Wed Apr 28, 2021 11:37 am
by baumunk
Hello Alex

We have licenses:
PDF-XChange Editor SDK
and PDF-XChange PRO SDK (with OCR) 9.0.352.0

With version 9.0.354.0 does not work either.

Baumunk

Re: Convert procedure hangs up.

Posted: Wed Apr 28, 2021 2:16 pm
by baumunk
Hello Alex

Update 2:

If I make this PDF OCR_MakeSearchable searchable before.
Does it work in x86 ...

Obviously PDFXEditCore.x86.dll is buggy.

Baumunk

Re: Convert procedure hangs up.

Posted: Fri Apr 30, 2021 8:12 am
by baumunk
Hello Alex,

I do not want to ask x times.
When can we expect a solution?
Our customers call often.

Mfg Ernest Baumunk

Re: Convert procedure hangs up.

Posted: Fri Apr 30, 2021 8:24 am
by Tracker Supp-Stefan
Hello baumunk,

Can you please provide us with a sample file that does cause the issue?
As you stated in your original post - with most of your files it does run, so we will need a sample that we can consistently reproduce this with, to be able to investigate further.

If the file is confidential - please e-mail it to support@pdf-xchange.com and we will treat it with all the confidentiality needed, and destroy it once done with our testing.

Kind regards,
Stefan

Re: Convert procedure hangs up.

Posted: Fri Apr 30, 2021 8:34 am
by baumunk
Hello Stefan

I have sent two sample PDF to support@pdf-xchange.com. As a zip file.

With kind regards
Ernest Baumunk

Re: Convert procedure hangs up.

Posted: Fri Apr 30, 2021 8:55 am
by Tracker Supp-Stefan
Hello baumunk,

Thanks! We received the files and I've already passed them along to Sasha to check them.

Kind regards,
Stefan

Re: Convert procedure hangs up.

Posted: Fri Apr 30, 2021 11:41 am
by Sasha - Tracker Dev Team
Hello baumunk,

Tried your sample files with the official 354 build in the FullDemo application - everything worked correctly:

Code: Select all

var quelle = @"E:\SDK Problems\36522\22.pdf";
var ziel = @"E:\SDK Problems\36522\22_pdfa.pdf";
if (!File.Exists(quelle)) return;
if (File.Exists(ziel)) File.Delete(ziel);
try
{
	PDFXEdit.IPXV_ExportConverter cnv = null;
	for (uint i = 0; i < pdfCtl.Inst.ExportConvertersCount; i++)
	{
		if (pdfCtl.Inst.ExportConverter[i].ID != "conv.exp.pdfa") continue;
		cnv = pdfCtl.Inst.ExportConverter[i];
		break;
	}

	if (cnv == null)
	{

		return;
	}

	var cab = pdfCtl.Inst.GetFormatConverterParams(false, "conv.exp.pdfa");
	PDFXEdit.ICabNode convParamsRoot = cab.Root;
	//var Format = PDFAFormat.PDFA_1B;
	convParamsRoot.SetInt("Part", 1);
	convParamsRoot.SetInt("Conformance", 1);
	convParamsRoot.SetInt("ShowReport", 0);
	convParamsRoot.SetString("ErrorMessage", "true");
	IAFS_Inst fsInst = (IAFS_Inst)pdfCtl.Inst.GetExtension("AFS");
	var destPath = fsInst.DefaultFileSys.StringToName(ziel);
	const int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_CreateAlways |
										AFS_OpenFileFlags.AFS_OpenFile_Read |
										AFS_OpenFileFlags.AFS_OpenFile_Write |
										AFS_OpenFileFlags.AFS_OpenFile_FullCache);
	var destFile = fsInst.DefaultFileSys.OpenFile(destPath, openFileFlags);
	IPXC_Inst docInst = (PXC_Inst)pdfCtl.Inst.GetExtension("PXC");
	var srcDoc = docInst.OpenDocumentFromFile(quelle, null);
	try
	{
		cnv.Convert(pdfCtl.Inst, srcDoc, destFile, 0, cab);//->No return !!!!
    }
	catch (Exception exp)
	{
		pdfCtl.Inst.ClearHistory(true);
		destFile.Close();
		srcDoc.Close();
	}
	pdfCtl.Inst.ClearHistory(true);
	destFile.Close();
	srcDoc.Close();
}
catch (Exception exp)
{
	MessageBox.Show($"{exp.Message}\r\n{exp.StackTrace}");
}
Cheers,
Alex

Re: Convert procedure hangs up.

Posted: Fri Apr 30, 2021 11:56 am
by baumunk
Hello Alex,

No, it works on my computer too (with the SDK installed).

But not on the customer PC with installation that you have shown here:

https://sdkhelp.pdf-xchange.com/view/PXV:Redistribution
So:
C: \ Windows \ System32 \ regsvr32.exe PDFXCoreAPI.x86.dll
C: \ Windows \ SysWOW64 \ regevr32.exe PDFXCoreAPI.x64.dll
C: \ Windows \ SysWOW64 \ regevr32.exe PDFXEditCore.x64.dll
C: \ Windows \ System32 \ regsvr32.exe PDFXEditCore.x86.dll
Resources.dat is copied to the application directory

I can video record you if you want.

However, I cannot tell the difference.

Kind regards
Ernest Baumunk

Re: Convert procedure hangs up.

Posted: Fri Apr 30, 2021 12:21 pm
by baumunk
Videos.zip
(4.42 MiB) Downloaded 110 times
Hello Alex,

I hope both records can help you.
Same x86 test program on my PC and on customer/test PC.

Developer pc.mp4 - on my PC
Test PC or Customer PC.mp4 others

Best regards
Ernest Baumunk

Re: Convert procedure hangs up.

Posted: Tue May 04, 2021 8:44 am
by Sasha - Tracker Dev Team
Hello baumunk,

I will redirect this problem to the developer, responsible for PDF/A - hopefully he can tell more.

Cheers,
Alex

Re: Convert procedure hangs up.

Posted: Tue May 04, 2021 11:36 am
by baumunk
Hello Alex,
How long we have to wait for the result.
Can't you answer either?

Best regards
Baumunk

Re: Convert procedure hangs up.

Posted: Tue May 04, 2021 1:03 pm
by Sasha - Tracker Dev Team
Hello baumunk,

I can't because I could not recreate the behavior. Thus the developer who has written the code himself will look at that.

Cheers,
Alex

Re: Convert procedure hangs up.

Posted: Tue May 04, 2021 5:51 pm
by Vasyl-Tracker Dev Team
Hi baumunk.

While we cannot reproduce it on our side - please provide the dump-file for process which hangs:
1. When it hangs - please go to the Task Manager\Details -> RClick ->Creat dump file
2. Upload this dump-file to our file-server (https://www.pdf-xchange.com/knowle ... le-service).

Thanks.

Re: Convert procedure hangs up.

Posted: Wed May 05, 2021 6:12 am
by baumunk
Hello,

I have uploaded dmpdatei.zip/baumunk.zip.

There are two *.dmp files in it:

TeatPDFA.DMP: Test PC/Customer PC program freezes.
TeatPDFA_devpc.DMP: Developer PC, same test program, same PDF program is running.

We really need urgent a solution for this problem.

With kind regards
Ernest Baumunk

Re: Convert procedure hangs up.

Posted: Wed May 05, 2021 12:50 pm
by Sasha - Tracker Dev Team
Hello baumunk,

Can we also ask for the sample project that you are using so we can copy the exact behavior while investigating.

Cheers,
Alex

Re: Convert procedure hangs up.

Posted: Wed May 05, 2021 1:11 pm
by baumunk
Hello Alex

Yes of course.
I have uploaded it to https://useruploads.tracker-software.support/#/HOME

as baumunk_testapp.zip
With xchange dll's and all plugin's folder.

Written C# Visual Studio 2019.
It can be compiled as x64 or x86 application.

With kind regards
Ernest Baumunk

Re: Convert procedure hangs up.

Posted: Wed May 05, 2021 6:30 pm
by Paul - Tracker Supp
Hi Ernest,

thanks for the files, I believe Alex has them now. I expect you will hear from him here once he has something.

regards

Re: Convert procedure hangs up.

Posted: Tue May 18, 2021 12:33 am
by Vasyl-Tracker Dev Team
Hi All.

Sorry for delay with answer here. The hang with convert to-PDF/A is fixed and fix will be available in the new 355 build. Please wait.

Cheers.

Re: Convert procedure hangs up.

Posted: Tue May 18, 2021 6:12 am
by baumunk
Hello Vasyl Yaremyn,

Do you know when version 355 will be released?
Paul O'Rorke has replied by email we may use version 354.1 as well.

With best regards
Ernest Baumunk

Re: Convert procedure hangs up.

Posted: Tue May 18, 2021 7:05 am
by Sasha - Tracker Dev Team
Hello baumunk,

Yes, you can use 354.1 - that precise issue was fixed in that build.

Cheers,
Alex