Convert procedure hangs up.

PDF-XChange Editor SDK for Developers

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

Convert procedure hangs up.

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

Re: Convert procedure hangs up.

Post by baumunk »

Update
If application x64 it works.
If application x86 does not work !!!
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post by Sasha - Tracker Dev Team »

Hello baumunk,

What SDK version are you using?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
baumunk
User
Posts: 38
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

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

Re: Convert procedure hangs up.

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

Re: Convert procedure hangs up.

Post 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
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Convert procedure hangs up.

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

Re: Convert procedure hangs up.

Post by baumunk »

Hello Stefan

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

With kind regards
Ernest Baumunk
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Convert procedure hangs up.

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
baumunk
User
Posts: 38
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

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

Re: Convert procedure hangs up.

Post by baumunk »

Videos.zip
(4.42 MiB) Downloaded 104 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
baumunk
User
Posts: 38
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post by baumunk »

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

Best regards
Baumunk
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Convert procedure hangs up.

Post 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.
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: 38
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
baumunk
User
Posts: 38
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post 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
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Convert procedure hangs up.

Post 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
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2351
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Convert procedure hangs up.

Post 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.
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: 38
Joined: Fri Nov 13, 2020 8:47 am

Re: Convert procedure hangs up.

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert procedure hangs up.

Post by Sasha - Tracker Dev Team »

Hello baumunk,

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

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