PDF-XChange Editor control issues.

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
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

PDF-XChange Editor control issues.

Post by bpatel »

Hi,

We have embedded the PDF-XChange Editor control in a Windows form. We are using the latest SDK 32-bit version 6.0.321.0. We cannot upgrade to the 64-bit version since our application has been implemented for the 32-bit version.
We use the PDF-XChange Editor control on the Windows form for the following:
- load 3000 page PDF files,
- manipulate bookmarks on the PDF file,
- search the PDF file, and
- review the PDF file

This functionality just got deployed to Production environment and we started getting the following issues:

1) Entire application crashes randomly when:
- navigating the pages using the arrow buttons at the bottom of the editor control,
- searching the 3000 page PDF file,
- multiple selection of the thumbnail pages.
This is very annoying for the users and we are not able to identify the cause because there is no exception thrown that we can handle. The application just closes.
I have attached the EventLog (ApplicationCrash_EventLog.txt) for this crash.

2) Randomly get a "Document unavailable" error message pop-up when user is searching for a single word in the PDF document.
- The user clicked ‘OK’ on the pop-up message and it looked as though the document was no longer loaded. However, when he clicked on the search result in the Search Results pane, the page loaded.

3) There is an issue when we try to rename a bookmark and the control is locked down.
Here's our scenario:
- There is a table in the database with "PDFFileName" as a column. This same table has another column "Locked".
- User1 opens a PDF file referred in this table in one session.
- User2 opens the same PDF file in another session and makes a change to the file but hasn't saved it yet, i.e. User2 has locked down the PDF file. The value of "Locked" column for this PDF file record is "True".
- When User1 tries to rename a bookmark on the PDF file we check for the value in the "Locked" column and if it is "True" (indicating someone else is working on this file) then we set the screen mode to a locked mode and also disable all the options that would allow you to manipulate the bookmarks and thumbnails for the "Bookmarks" and "Thumbnails" panes in the PDF-XChange Editor control.
- This is when a "AccessViolationException" exception is thrown.
- The same works fine when trying to Create/Delete a bookmark as well as when trying to Set Destination for a bookmark (where Locked = True). The screen successfully locks out and no exception is thrown.
- It is only when trying to rename a bookmark (where Locked = True) that the "AccessViolationException" exception is thrown.
- I have attached a test application (TestPDFXChangeEditor.zip) to replicate this issue and also attached a screenshot (AccessViolationException_RenameBookmark.PNG) of the exception. I used your Online PDF Reference guide "PDF32000_2008.pdf" for my test application. You can use the same to reproduce this issue.
- When you run the application, check the checkbox labled "Lock Screen when making changes" and then try to rename a bookmark and you will get the exception. You can try the same with Create/Delete a bookmark as well as Set Destination for a bookmark and no exception will be thrown with the checkbox as checked.

Please let me know if you have any questions.
Thanks for all the help in resolving these issues.

Regards,
Bijalkumar D. Patel
Logistics Health, Inc.
Attachments
ApplicationCrash_EventLog.pdf
EventLog for the Application Crash
(2.91 KiB) Downloaded 224 times
AccessViolation Exception
AccessViolation Exception
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

The files that you've attached contained a valid licence key.
Please do NOT post your license information on the forums, or we will be forced to deactivate it!

This code is not correct:

Code: Select all

Private Sub ResetChanges()
	Dim intTotalDocCount As Integer = 0
	Dim doc As PDFXEdit.IPXV_Document = Nothing
	Dim intModificationLevel As Integer = 0
	Try
		m_blnResetChanges = True
		intTotalDocCount = oPDFCtrl.Inst.DocCount()
		If intTotalDocCount > 0 Then
			For i As Integer = 0 To intTotalDocCount - 1
				doc = oPDFCtrl.Inst.Doc(i)
				If doc IsNot Nothing AndAlso doc.Modified Then
					oPDFCtrl.Inst.ActiveDoc = doc
					intModificationLevel = doc.ModificationLevel
					While doc.Modified
						oPDFCtrl.Undo()
						If doc.ModificationLevel = intModificationLevel - 1 Then
							intModificationLevel = doc.ModificationLevel
						Else
							doc.SetModified(False, 1)
							intModificationLevel = doc.ModificationLevel
						End If
					End While
				End If
				doc = Nothing
			Next i
		End If
		m_blnResetChanges = False
	Catch ex As Exception
		Throw
	Finally
		doc = Nothing
	End Try
End Sub
You should not change the Modification Flags manually unless you really know what you are doing - this can lead to potential crashes. Yet you are using that along with the Undo() method of the IPXV_Control. The IPXV_Inst::RevertDoc should be used instead - this method is being used by the File/Revert command in the End-User Editor.
Also, I have not experienced any exceptions whatsoever. Updated your code and try again.

As for the 1) and 2) - we can't possibly tell what your code or program does and what memory you are forgetting to release. As this is C# - making a x86 application is a bad idea - the C# itself eats a lot of memory. Also, it does not give you a clear way to manage the memory that you are using. Thus we cannot possibly know where exactly is the problem.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

Thank you for your reply. Sorry about the license key. Henceforth, I will make sure that I don't post any License information.

Thanks,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

The reason why I added the logic to decrement the document's ModificationLevel (please refer to the logic below) is because in some cases the Undo() method neither caused the doc.Modified() to be set to False nor did the doc.ModificationLevel decrease. The execution went into an indefinite "While" loop since the doc.Modified() always remained True.

Code: Select all

Private Sub ResetChanges()
        Dim intTotalDocCount As Integer = 0
        Dim doc As PDFXEdit.IPXV_Document = Nothing
        Dim intModificationLevel As Integer = 0
        Try
            m_blnResetChanges = True
            intTotalDocCount = oPDFCtrl.Inst.DocCount()
            If intTotalDocCount > 0 Then
                For i As Integer = 0 To intTotalDocCount - 1
                    doc = oPDFCtrl.Inst.Doc(i)
                    If doc IsNot Nothing AndAlso doc.Modified Then
                        oPDFCtrl.Inst.ActiveDoc = doc
                        intModificationLevel = doc.ModificationLevel
                        While doc.Modified
                            oPDFCtrl.Undo()
                            If doc.ModificationLevel = intModificationLevel - 1 Then
                                intModificationLevel = doc.ModificationLevel
                            Else
                                doc.SetModified(False, 1)
                                intModificationLevel = doc.ModificationLevel
                            End If
                        End While
                    End If
                    doc = Nothing
                Next i
            End If
            m_blnResetChanges = False
        Catch ex As Exception
            Throw
        Finally
            doc = Nothing
        End Try
    End Sub
As per your suggestion I changed the logic to use the IPXV_Inst::RevertDoc (please refer to the logic below) instead, and after that line of code gets executed if I check doc.Modified() it still shows True. Also I still get the same AccessViolationException with this change.

Code: Select all

Private Sub ResetChanges()
        Dim intTotalDocCount As Integer = 0
        Dim doc As PDFXEdit.IPXV_Document = Nothing
        Try
            m_blnResetChanges = True
            intTotalDocCount = oPDFCtrl.Inst.DocCount()
            If intTotalDocCount > 0 Then
                For i As Integer = 0 To intTotalDocCount - 1
                    doc = oPDFCtrl.Inst.Doc(i)
                    If doc IsNot Nothing AndAlso doc.Modified Then
                        oPDFCtrl.Inst.ActiveDoc = doc
                        oPDFCtrl.Inst.RevertDoc(doc)
                    End If
                    doc = Nothing
                Next i
            End If
            m_blnResetChanges = False
        Catch ex As Exception
            Throw
        Finally
            doc = Nothing
        End Try
    End Sub
Am I doing something wrong here? Also I fail to understand why oPDFCtrl.Undo() wouldn't work.

Thanks,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

Managed to catch the exception that you've experienced in 3. Though after switching to our Debug dll - the exception disappeared. I will prepare a Dev. Build in a day or two so that you can try the newer dll.
The Undo() holds limited number of items (especially for x86) and should be used for undoing a couple of operations at most. In your case, when you are doing vast modifications, the Undo data could grow into a pretty big one, thus the troubles that you've experienced can occur.
As for the 1 and 2 - we will need a full code + data + reproducing steps - only then we can look into this.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

The Dev. Build is out - you can download it by the link mentioned here:
https://forum.pdf-xchange.com/ ... 66&t=25943

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

Thanks for the quick turnaround! Can we use this DLL for production deployment? If not, then when can we expect this fix in the latest PDF-XChange Editor Core API release so that we can use it in production?

Thanks,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

Sadly this is an experimental dev. build and it cannot be used in the production. But the official release will be held in a week or so - then you can get and official dll that you can use,

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Thanks Alex! Let me try this Development DLL and test it out. I'll update you of the outcome.

Thanks,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

It didn't work out for me. I used the Development Build DLL ver. 6.0.321.18119 that you sent the link to but I still got the same "AccessViolationException" exception.
I just referred the Development Build DLL in my project that created an Interop DLL "Interop.PDFXEdit.dll" and I still had the old ActiveX Interop DLL "AxInterop.PDFXEdit.dll" being referred in my project. Am I doing anything wrong here?
Please let me know if you need anymore information from me.

Thanks,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

If you are using a regsvr32 method then you will have to remove the old reference from the Reference list and add the new reference.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

Do you mean the old reference to the ActiveX Interop DLL "AxInterop.PDFXEdit.dll" needs to be removed from the project references? If I remove that from the project references how does it get added back? When I refer the new Development build DLL in my project it only creates the "Interop.PDFXEdit.dll" and not "AxInterop.PDFXEdit.dll".
Please advice.

Thanks,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

The AxInterop is from the Control that is added on your form. You will need to update it's reference too. Though this one is a little harder, because probably you will need to remove and add the Control itself and this will probably remove some logic behind it - for example some Control properties and methods like OnEvent. Though you can just copy everything and replace later.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Got you!
Thanks Alex.

Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

I tested my sample application with the Development Build DLL ver. 6.0.321.18119 that you sent the link to but I still got the same "AccessViolationException" exception.
I have attached the screenshots of the AccessViolationException.
AccessViolationException.png
Error.png
Error.png (14.65 KiB) Viewed 5038 times
EventViewerLog.PNG
I have also attached the test application to reproduce the error.

Thanks,
Bijalkumar D. Patel
Logistics Health, Inc.
Attachments
TestPDFXChangeEditor.zip
(616.1 KiB) Downloaded 91 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

I found a problem - will deploy a dev build tomorrow.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

Please try our latest dev. build available from here:
https://forum.pdf-xchange.com/ ... 66&t=25943

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hello,

This is regarding the 3rd issue mentioned in this post above on April 24. We still have that issue. The reason I am bringing this back is now this functionality is heavily used in our application and it is affecting the users productivity.
When we try to rename a bookmark and the control is locked down we get a "AccessViolationException" exception.
I have attached a test application (TestPDFXChangeEditor.zip) to replicate this issue and also attached a screenshot (AccessViolationException_RenameBookmark.PNG) of the exception. I used your Online PDF Reference guide "PDF32000_2008.pdf" for my test application. You can use the same to reproduce this issue.
This is how you can replicate this issue:
- When you run my test application, check the checkbox labeled "Lock Screen when making changes" and then try to rename a bookmark and you will get the exception. You can try the same with Create/Delete a bookmark as well as Set Destination for a bookmark and no exception will be thrown with the checkbox as checked.

I am using the latest DEV build DLL version 6.0.322.18726.
Please help us solve this issue.

Thanks and Regards,
Bijalkumar D. Patel
Exception screenshot
Exception screenshot
Logistics Health, Inc.
Attachments
TestPDFXChangeEditor.zip
Test application
(612.66 KiB) Downloaded 53 times
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hello,

Any update on this issue? Please let me know if you need any more information from me.
It is really important for us to get this issue resolved.

Thanks and Regards,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

Good news for you - hopefully fixed all of your problems with small piece of code:

Code: Select all

Public Sub RefreshWithMode(ByVal eScreenMode As ScreenMode)
    Try
        m_CurrentScreenMode = eScreenMode
		If m_CurrentScreenMode = ScreenMode.Locked Then
			oPDFCtrl.Focus() ' Add this
			ResetChanges()
			CloseAllDocs()
			InitializeControls()
		ElseIf m_CurrentScreenMode = ScreenMode.Normal Then
			oPDFCtrl.Focus() ' Add this
			ResetChanges()
			CloseAllDocs()
			InitializeControls()
		ElseIf m_CurrentScreenMode = ScreenMode.Update Then
			SetControlsEditMode()
        End If

    Catch ex As Exception
        Throw
    End Try
End Sub
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

The issue is still not fixed :(
I tried what you asked me to change in the code and I still get the same "System.AccessViolationException" exception. Are you able to reproduce this issue on your end? I am also attaching the EventViewer logs from my machine. Hope this helps!
EventViewerLog.PNG
EventViewerLog.PNG (2.92 KiB) Viewed 4743 times
EventViewerLog1.PNG
EventViewerLog2.PNG
I am using the latest DEV build DLL "PDFXEditCore.x86.dll" version 6.0.322.18726.

Thanks and Regards,
Bijalkumar D. Patel
Logistics Health, Inc.
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

Any update on this issue? With the number of users using this functionality in our application been increased significantly, this issue is a big road-blocker and is affecting them in a big way.
Could this issue be expedited?

Thanks and Regards,
Bijalkumar D. Patel
Logistics Health, Inc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PDF-XChange Editor control issues.

Post by Sasha - Tracker Dev Team »

Hello bpatel,

There will be a major release in a week or so. I say wait for it and see whether the problem is already fixed.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hi Alex,

I have used the latest DEV build DLL in my test application to reproduce the issue. How is the major release within a week going to help? Is this issue being actively investigated and scheduled to be fixed and released in that major release?

Thanks and Regards,
Bijalkumar D. Patel
Logistics Health, Inc.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange Editor control issues.

Post by Tracker Supp-Stefan »

Hello Bijalkumar D. Patel,

I've just spoken with Sasha and he has told me that some changes have been done indeed, and that is why he was requesting for your patience.
Also - we are quite close to the release of the new build, and that is currently taking up all his time, but once the new build it out - he will have time to look at the logic you are applying as he believe the logic might also be contributing to the problem.

Regards,
Stefan
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hello Stefan,

Please let me know once the new build is out so that I can test my Test application with that build DLL to check if the issues have been resolved.

Thanks and Regards,
Bijalkumar Patel
Logistics Health, Inc.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange Editor control issues.

Post by Tracker Supp-Stefan »

Hello bpatel,

This should happen tomorrow 30 Nov, as our plans for today got disrupted by a critical issue we found in one of the components that has to be fixed before the release.

Regards,
Stefan
bpatel
User
Posts: 42
Joined: Thu Jan 05, 2017 4:53 pm

Re: PDF-XChange Editor control issues.

Post by bpatel »

Hello Stefan,

What will be the release number that I should look out for?
Is this a DEV build or a product Release?

Thanks,
Bijalkumar Patel
Logistics Health, Inc.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange Editor control issues.

Post by Tracker Supp-Stefan »

Hello Bijalkumar Patel,

It will be a new version release for all our products - including end user and developer ones.
The new numbering will be V7.0 build 323.0

Cheers,
Stefan
Post Reply