Convert procedure hangs up.

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

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.
Post Reply
baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Convert procedure hangs up.

Post by baumunk » Wed Apr 28, 2021 8:12 am

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!!!

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Wed Apr 28, 2021 9:44 am

Update
If application x64 it works.
If application x86 does not work !!!

User avatar
Sasha - Tracker Dev Team
User
Posts: 5460
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post by Sasha - Tracker Dev Team » Wed Apr 28, 2021 10:51 am

Hello baumunk,

What SDK version are you using?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Wed Apr 28, 2021 11:37 am

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

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Wed Apr 28, 2021 2:16 pm

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

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Fri Apr 30, 2021 8:12 am

Hello Alex,

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

Mfg Ernest Baumunk

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14462
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Convert procedure hangs up.

Post by Tracker Supp-Stefan » Fri Apr 30, 2021 8:24 am

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@tracker-software.com and we will treat it with all the confidentiality needed, and destroy it once done with our testing.

Kind regards,
Stefan

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Fri Apr 30, 2021 8:34 am

Hello Stefan

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

With kind regards
Ernest Baumunk

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14462
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Convert procedure hangs up.

Post by Tracker Supp-Stefan » Fri Apr 30, 2021 8:55 am

Hello baumunk,

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

Kind regards,
Stefan

User avatar
Sasha - Tracker Dev Team
User
Posts: 5460
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post by Sasha - Tracker Dev Team » Fri Apr 30, 2021 11:41 am

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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Fri Apr 30, 2021 11:56 am

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.tracker-software.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

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Fri Apr 30, 2021 12:21 pm

Videos.zip
(4.42 MiB) Downloaded 9 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

User avatar
Sasha - Tracker Dev Team
User
Posts: 5460
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post by Sasha - Tracker Dev Team » Tue May 04, 2021 8:44 am

Hello baumunk,

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

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Tue May 04, 2021 11:36 am

Hello Alex,
How long we have to wait for the result.
Can't you answer either?

Best regards
Baumunk

User avatar
Sasha - Tracker Dev Team
User
Posts: 5460
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post by Sasha - Tracker Dev Team » Tue May 04, 2021 1:03 pm

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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2043
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Convert procedure hangs up.

Post by Vasyl-Tracker Dev Team » Tue May 04, 2021 5:51 pm

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.tracker-software.com/knowle ... le-service).

Thanks.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Wed May 05, 2021 6:12 am

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 5460
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post by Sasha - Tracker Dev Team » Wed May 05, 2021 12:50 pm

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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

baumunk
User
Posts: 33
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk » Wed May 05, 2021 1:11 pm

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

User avatar
Paul - Tracker Supp
Site Admin
Posts: 5212
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Convert procedure hangs up.

Post by Paul - Tracker Supp » Wed May 05, 2021 6:30 pm

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
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

Post Reply