PlaceWatermark stalls on large documents - CRITICAL

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, 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
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi -

In our application we are using the Core API and (among others) the PlaceWatermark call.
We are finding that on large documents ( many pages - several hundred or thousands) something is
causing the call to slow down during processing and eventually stall completely forcing us to use Task Mgr
to kill the process.

Our client requirements force us to watermark each page individually, but even when we stamp all pages the same
we get stalled.

We have a client delivery next week and this is causing tremendous grief for us.

This is the pertinent code we are using as a test that is failing (VB6)
Please note I have omitted the code that we use to license/activate the CoreAPI
Also, I can send only one sample document that does not require NDA with our clients - let me know how to send it to you.

Code: Select all

Private Sub Form_Load()
    Set pxcInst = New PXC_Inst 
    Set pAInt = pxcInst.GetExtension("AUX") 
End Sub

Private Sub stampBut_Click()
    Dim str_error As String
    Dim pageCount As Long
    Dim dPageWidthCurrent As Double
    Dim dPageHeightCurrent As Double
    Dim fileName As String
    Dim convertedFileName As String

    On Error GoTo nofile:
    cdlg.CancelError = True
    str_error = "No file chosen"
    cdlg.Filter = "PDF Files (*.pdf)|*.pdf"
    cdlg.DialogTitle = "Load an existing PDF File"
    cdlg.ShowOpen
    On Error GoTo 0
    
    fileName = cdlg.fileName
    ' make a copy of the original file and use that in order to keep the original file unchanged
    Dim ipos As Integer
    ipos = Len(fileName) - InStrRev(fileName, ".") + 1
    convertedFileName = Left(fileName, Len(fileName) - ipos) & "-WEH" & GetTickCount & ".pdf"
    FileCopy fileName, convertedFileName
    
    ' load the document
    If Not api.loadPdfFile(convertedFileName, pDoc, gInst) Then
        str_error = "Could not load file: " & ReturnFileName(convertedFileName) & vbNewLine & Err.Description
        GoTo nofile
    End If
    
    Dim timeThen As Date
    statusTxt.Text = statusTxt.Text & "*********** NEW TEST *************" & vbNewLine
    statusTxt.Text = statusTxt.Text & ReturnFileName(convertedFileName) & vbNewLine
    timeThen = Now
    statusTxt.Text = statusTxt.Text & "Start: " & timeThen & vbNewLine
    statusTxt.SelStart = Len(statusTxt.Text)
    DoEvents

    Dim i As Integer
    Dim sError As String
    Dim pageRectangle As PXC_Rect
    Dim currentPage As IPXC_Page
    Dim wmark As IPXC_WatermarkParams
    
    Set wmark = pxcInst.CreateWatermarkParams()
        
    For i = 0 To pDoc.Pages.Count - 1
        ' get the current page
        Set currentPage = pDoc.Pages.Item(i)

        'These methods are normally used for placement purposes but are commented out here for basic testing
        ''get the bounding box for the page
       ' pageRectangle = currentPage.Box(PBox_PrintBox)
        '' interchange the height and width of page if needed
        'interchangeHeightWidth currentPage.Rotation, pageRectangle
        '' calculate the page dimesions and the new page sizes
        'calculatePageHeightWidth pageRectangle, dPageWidthCurrent, dPageHeightCurrent
        
        With wmark
            .VOffset = 30#  'points
            .HOffset = 30#  'points
            .WatermarkType = PXC_WatermarkType.Watermark_Text
            .RenderMode = PXC_TextRenderingMode.TRM_Fill
            .Scale = 100
            .FontName = "Arial"
            .FillColor.SetRGB 255, 0, 0
            .Opacity = 100
            .FontSize = 12
            .Rotation = 0
            .Text = "TopLeft"
        End With

        ' set the page on which watermark should apply
        Set pIndex = pAInt.CreateBitSet(pDoc.Pages.Count) 'this MUST be set every page
        pIndex.Set i, 1 ' Placing watermark on current page
        pDoc.PlaceWatermark pIndex, wmark
        
        Set currentPage = Nothing
        Set pIndex = Nothing
        pageLabel.Caption = "Page: " & i + 1 & " of " & pDoc.Pages.Count
        DoEvents
    Next i
    
    ' save the file
    If Not api.savePdfFile(convertedFileName, pDoc) Then
        str_error = "Could not save file."
        GoTo nofile
    End If
    
    statusTxt.Text = statusTxt.Text & "Finish: " & Now & vbNewLine
    statusTxt.Text = statusTxt.Text & "Diff: " & DateDiff("s", timeThen, Now) & " seconds" & vbNewLine
    statusTxt.SelStart = Len(statusTxt.Text)
    DoEvents

    ' open the file
    ShellExecute 0&, "open", convertedFileName, "", "", vbNormalFocus
    
    Set currentPage = Nothing
    Set wmark = Nothing 
    Exit Sub
nofile:
    statusTxt.Text = statusTxt.Text & str_error & vbNewLine
    MsgBox str_error
End Sub

Private Sub interchangeHeightWidth(ByVal pageAngle As Long, ByRef pageRectangle As PXC_Rect)
    If pageAngle = 90 Or Abs(pageAngle) = 270 Then
        Dim xTemp
        xTemp = pageRectangle.Top
        pageRectangle.Top = pageRectangle.Right
        pageRectangle.Right = xTemp
    End If
End Sub

Private Sub calculatePageHeightWidth(ByRef pageRectangle As PXC_Rect, ByRef dPageWidthCurrent As Double, ByRef dPageHeightCurrent As Double)
    'get the width and height of the image from the page bounding box
    dPageWidthCurrent = Abs(pageRectangle.Right - pageRectangle.Left)
    dPageHeightCurrent = Abs(pageRectangle.bottom - pageRectangle.Top)
End Sub

Private Function ReturnFileName(ByVal sPath As String) As String
    'Returns full file name
    Dim i As Long
    Dim tmpChr As String

    For i = Len(sPath) To 1 Step -1
        tmpChr = Mid$(sPath, i, 1)
        If tmpChr = "\" Or tmpChr = "/" Then
            ReturnFileName = Right$(sPath, Len(sPath) - i)
            Exit Function
        End If
    Next i

    ReturnFileName = sPath
End Function
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Please mail me that PDF directly to polaringu@tracker-software.com and we'll look at the problem tomorrow.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

I've sent the file.
If I can find another sample that I am allowed to send I will let you know.

Also, just an FYI - I downloaded the current free Editor (v6 build 322.4) and noticed that it can
stamp my files extremely fast - this sample is stamped in only a few seconds.
Is there a different API used than "CoreAPI > PlaceWatermark" ?

Thanks.
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

One more note -

I just rebuilt this program in C# and am having the same issues, almost exactly (actual page numbers where stalling occurs is slightly different)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,
stamp my files extremely fast
You mean the End-User Add Watermark feature?
Also, do you need to place an unique watermark on each page? Because you can specify a pages range for all of the pages.

Just tested on your document - works for me:

Code: Select all

private void PlaceWatermark(PDFXEdit.IPXC_Document Doc, PDFXEdit.IPXC_Inst Inst)
{
	PDFXEdit.IAUX_Inst aInst = (PDFXEdit.IAUX_Inst)Inst.GetExtension("AUX");
	PDFXEdit.IBitSet bs = aInst.CreateBitSet(Doc.Pages.Count);
	PDFXEdit.IPXC_WatermarkParams wp = Inst.CreateWatermarkParams();
	bs.Set(0, Doc.Pages.Count); //We will place watermarks on all of the pages
	wp.Text = "QWERTY";
	wp.Scale = 100;
	wp.FontSize = Convert.ToSingle(50);
	wp.FontName = "Arial Bold";
	Doc.PlaceWatermark(bs, wp);
}

private void placeWatermarkToolStripMenuItem_Click(object sender, EventArgs e)
{
	PDFXEdit.PXC_Rect rc;
	PDFXEdit.IPXC_Document coreDoc = pxcInst.OpenDocumentFromFile(@"D:\SDK problems\CAM for GFD\CAM for GFD.pdf", null);
	PlaceWatermark(coreDoc, pxcInst);
	pdfCtl.OpenDocFrom(coreDoc);
}
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: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

I've found the problem with your code. The problem was in the bitset that represents which pages should be used for placing watermarks. Setting a bitset value to 1 will cause the page to be used in the placement process. if the value is 0 then this page will be omitted. After each cycle iteration you have added the n-th page to the bitset without clearing the previous values. This resulted in the next behavior:
1st iteration - 1 page
2nd iteration - 1, 2 pages
3rd iteration - 1, 2, 3 pages
.....
The correct way of handling this (if each page requires unique watermark text) is to clear the bitset value after PlaceWatermark method in the end of each iteration:

Code: Select all

coreDoc.PlaceWatermark(bs, wp);
bs.Set(i, 1, false);
Though if you need to place watermarks with the same text on every page then use the method I gave you in the previous post.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

Thanks for the quick response, but I've now tried your suggestion in both my VB6 and my C# sample
apps and I still get the exact same results.
Also, if you notice my VB6 code creates, sets, then destroys the BitSet so I'm not completely sure this would resolve the issue anyway.

The file I sent to you causes 'stalling' at several points during stamping making the total time to stamp 38 - 45 seconds.
The fastest it's ever worked is about 10 seconds but it is not reliable and rarely repeatable.

Unfortunately, we are not able to stamp all pages the same.

I also have another file that stalls completely at page 228 of 1266 in both test apps, but in your free Exchange Editor for example,
it processes completely in about 25 seconds with stamping in 6 areas. So I can verify that your code and my machine can handle
my files properly.
Image

Here's the main portion of my C# code:

Code: Select all

                    for (uint i = 0; i < pDoc.Pages.Count; i++)
                    {
                        pIndex = pAint.CreateBitSet(pDoc.Pages.Count);
                        pIndex.Set(i, 1);
                        pDoc.PlaceWatermark(pIndex, wmark);
                        pIndex.Set(i, 1, false);
                        pageLabel.Text = "Page: " + (i+1) + " of " + pDoc.Pages.Count;
                        Application.DoEvents();
                    }
I'm not sure what else I can do at this point but the performance is simply not usable even with this simple test.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Please try this code in the FullDemo application (replacing the document's path with yours):

Code: Select all

PDFXEdit.IPXC_Inst pxcInst = (PDFXEdit.IPXC_Inst)pdfCtl.Inst.GetExtension("PXC");
PDFXEdit.IAUX_Inst auxInst = (PDFXEdit.IAUX_Inst)pdfCtl.Inst.GetExtension("AUX");
PDFXEdit.IPXC_Document coreDoc = pxcInst.OpenDocumentFromFile(@"D:\SDK problems\CAM for GFD\CAM for GFD.pdf", null);
PDFXEdit.IBitSet bs = auxInst.CreateBitSet(coreDoc.Pages.Count);
PDFXEdit.IPXC_WatermarkParams wp = pxcInst.CreateWatermarkParams();
for (uint i = 0; i < coreDoc.Pages.Count; i++)
{
	bs.Set(i, 1); //We will place watermarks on first 4 pages
	wp.Text = i.ToString();
	wp.Scale = 100;
	wp.FontSize = Convert.ToSingle(50);
	wp.FontName = "Arial Bold";
	coreDoc.PlaceWatermark(bs, wp);
	bs.Set(i, 1, false);
}
pdfCtl.OpenDocFrom(coreDoc);
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

We are not using the Editor API....are you suggesting that I download and install it
to test?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Yes, as it is free for testing - please try download it and use it - it uses the same code as for the Core API inside. This would be easier to test the behavior.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Where should this test code be placed ?

Also, are you able to test my C# code?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Just create a button on form and place that code there. Do not forget to change the file path.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -
Ok, I've tried your sample Editor code in both the FullDemo and in my own C# sample
and everything works perfectly - no stalling, no locking up, speed is about the same as in the PDFX-Change Editor.

This is not very good for us.

We have been told that the code for the Core is the same as the code for the Editor - clearly they behave differently.

We need a solution ASAP - what can we do?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Then the bug is in your code. And I think I know where the problem lies:

Code: Select all

                    for (uint i = 0; i < pDoc.Pages.Count; i++)
                    {
                        pIndex = pAint.CreateBitSet(pDoc.Pages.Count);
                        pIndex.Set(i, 1);
                        pDoc.PlaceWatermark(pIndex, wmark);
                        pIndex.Set(i, 1, false);
                        pageLabel.Text = "Page: " + (i+1) + " of " + pDoc.Pages.Count;
                        Application.DoEvents();
                    }
Probably the DoEvents code significantly slows down your application.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -
It is not the DoEvents method.

I have added into my current tests while using the Editor SDK and it still works perfectly.

Plus, I have commented it out of my other applications and it has made no difference.
DoEvents is simply allowing the processor to perform other tasks during idle processing time.
I'm using it to display the current page number during processing.

Clearly the difference is in the two SDKs...and we need a solution...
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

There are no differences between Core API and Editor SDK on a IPXC level. Try creating a clean C# project with CoreApi dll included and try my code - it should work as in FullDemo.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Alex -

I have a clean C# program that I already wrote - that's the code I pasted earlier in this thread.
And it still has the same problems that don't show up with the Editor version....

I 'll email a copy of the project for you to test.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

I've tested the behavior in your project. The thing is that the Cleaner is working throughout the watermarking process in the CoreApi and also in the Editor SDK by default. It seems you were testing a Add Watermark command from the Control directly. Well, it would behave like the End-user Editor because the Performance settings for it are different. Here are the screenshots of pure Core API and Editor SDK work:
Core:
Before.PNG
Editor SDK:
EditorSDK.PNG
As you can see, the Editor SDK takes even longer time to do this procedure.
All of this is because of the default cleaner work.

In the Editor SDK you can do something like this to give the cleaner more memory to clean for one time:

Code: Select all

pInst = new PXV_Inst();
pInst.Init(null);
pInst.Settings["Performance.UseMemExact"].v = true;
pInst.Settings["Performance.MemExact"].v = 500;
pInst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Performance);
Though in the Core API there is no such a mechanism to do this - we will try to add this until the next major release (323).

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

Let me go through your points one by one:
It seems you were testing a Add Watermark command from the Control directly. Well, it would behave like the End-user Editor because the Performance settings for it are different.
Yes - I was using the control directly - I was using the code you supplied to me.
In the Editor SDK you can do something like this to give the cleaner more memory to clean for one time:
Code: Select all
pInst = new PXV_Inst();
pInst.Init(null);
pInst.Settings["Performance.UseMemExact"].v = true;
pInst.Settings["Performance.MemExact"].v = 500;
pInst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Performance);
I used the SDK out-of-the-box with your supplied code - I never touched any of the memory related settings you are showing - are you saying that the control's settings are
better out-of-the-box than the Core SDK and the Editor/Core SDK ?
Though in the Core API there is no such a mechanism to do this - we will try to add this until the next major release (323).
We cannot wait for a new release!
As I have mentioned several times, our clients are having major failures in Production - right now.
I need a solution now.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,
I used the SDK out-of-the-box with your supplied code - I never touched any of the memory related settings you are showing - are you saying that the control's settings are
better out-of-the-box than the Core SDK and the Editor/Core SDK ?
These are not "better" - it's just that the cleaner has a lower limit when he starts to clean - in the summary - nothing changes. When the Control starts it has some default preloads (as the End-User Editor) basically taking more memory limit (meaning taking more free memory from you). There could be another user that would tell us that we are "eating" too much memory - the exact opposite of your case.
I will say again - shifting a memory limit will give you a fast work for a time, but then a cleaner would take place and do it's work for all of the memory taken - and that would be as long as a sum of these small stalls.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

One important aspect of this that is not being addressed is that we have many files that fail to process at all.
So the issue is not simply one of memory or speed - it is more importantly about complete failure.

The Editor Control successfully handles every file we attempt to process.
The Core SDK (and I assume the Editor SDK) fails on many of our files - stalling, and locking up our application.

I cannot supply these files to you due to client restrictions but I could certainly show you during a web meeting.

So again, we need a solution to this problem now...
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Ivan - Tracker Software »

Just a thought: maybe it will help to reduce memory usage and the Cleaner impact, when you will place one watermark on all pages, instead of individual watermark for each page? In this case, your code may look like:

Code: Select all

pIndex = pAint.CreateBitSet(pDoc.Pages.Count);
pIndex.Set(0, pDoc.Pages.Count);
pageLabel.Text = "Page: %[Page] of %[Pages]";
pDoc.PlaceWatermark(pIndex, wmark);
HTH
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Thanks, I've tried that (for testing purposes) and it does not help.
Also, we are placing a different watermark on all pages and cannot use the same for all.

We really need a solution to this problem now....
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

We've prepared a custom build for you, derived from the 322.5 build containing the fixes that you require:
http://docu-track.co.uk/devbuilds/19034/PDFXCoreAPI.zip
Also, there is a new method IPXC_Inst::SetMemoryLimit that allows you to set the memory limit for the Cleaner I was talking about previously. Note that you won't be able to put more than 1Gb (due to Win32 memory usage limit), so we advice using 500Mb-1Gb range if you would require that.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

Thanks for the quick turn-around.

I will test this immediately and get back today with a reply.

One more question though - I see there are 2 new DLLs but no new TLB files?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Updated. Please download again.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Thanks...
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

I've tested the revised SDK, and I cannot get it to work with VB6

The code throws an error when I try to use "SetMemoryLimit"

The error is "Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic."

(A side note - the function works properly in C#, however our current code base is in VB6)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

And what about stalls - did you catch any? Also, the overall speed should be increased even without that method.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

The new API seems to fix the issue in C# - no stalls or issues (as of my current testing).

Now I'm only left with the VB6 issue - apparently the problem is that SetMemoryLimit requires a UINT
which VB6 does not support...
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Updated the type for that method - should probably work for the VB6 now. Please download the same archive again.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi Alex -

The most recent version works in VB6 - thanks.

Preliminary tests seem to be good - I'll be testing more over the next two days to certain and will inform you of the results.

Thanks again for addressing this issue so quickly.

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

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Tracker Supp-Stefan »

Hi Wayne,

Glad to hear it seems resolved now!
Alex has finished for the day - but I will pass your thanks to him when he comes in tomorrow morning!

Cheers,
Stefan
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by whoit »

Hi All -

I wanted to update you - the SetMemoryLimit API seems to have fixed our issue - we've done a lot of testing and it seems solid - thank you for your quick handling of this.

I know the upper limit is 1gb (1000) but I wanted to get some clarification - this value sets the amount of RAM that can potentially be used, correct?
If that is true, then there should be no downside to setting the value to 1000 by default - correct?

Thanks,
Wayne
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: PlaceWatermark stalls on large documents - CRITICAL

Post by Sasha - Tracker Dev Team »

Hello whoit,

Glad that it works for you. As for the memory limit for cleaner, there won't be any downside except of the cleaner work when this limit is exceeded.

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