PdfViewCtrl Memory consumption

183 views
Skip to first unread message

Dirk

unread,
Sep 19, 2014, 9:49:05 AM9/19/14
to pdfne...@googlegroups.com
Hi,

I'm using the PDFView control from PDFnet.

I have version 6.2.1.23927 (official kit)
I can instantiate 12 controls, then the application crashes with 'bad allocation'

With a previous version (5.8.0.0) I can instantiate more then 25 controls...

I tried it with the download I found in this forum (6.2.4.0) but this one gives me
Message: Not enough storage is available to process this command.
Conditional expression: ip::interprocess_exception
Filename: MappedFile.cpp
Function: trn::Filters::MappingManager::CreateMapping
Linenumber: 237

I reduced the code to basically:

Dim _PdfDoc As PDFDoc
Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
PdfViewCtrl1.EnableScrollbar(False)
_PdfDoc = New PDFDoc("C:\temp\20140716_20140716_STATION1_BATCH261_11531.pdf")
_PdfDoc.InitSecurityHandler()
PdfViewCtrl1.SetDoc(_PdfDoc) PdfViewCtrl1.SetPagePresentationMode(PDFViewCtrl.PagePresentationMode.e_single_page)
PdfViewCtrl1.ShowNavPanel(True)
End Sub

Am I doing something wrong ?
Thanks in advance
Dirk Rijmenants

Support

unread,
Sep 19, 2014, 1:13:57 PM9/19/14
to pdfne...@googlegroups.com

Newer versions of PDFNet are taking advantage of disk caching to speed-up rendering (this is especially visible on large complex documents such as CAD files).  You can completely disable viewercaching with:

PDFNet.SetViewerCache(0, false)

or you can adjust it to some other more suitable levels.


In order to all generation of multi-gigabyte files PDFNet is also caching files to disk during PDF generation or editing. If you want to prevent any type of disk caching (e.g. you are concerned re: leaving any traces of data on disk) use PDFNet.SetDefaultDiskCachingEnabled(false).

Dirk

unread,
Sep 22, 2014, 4:06:37 AM9/22/14
to pdfne...@googlegroups.com
Hi,

I disabled the viewercaching:  PDFNet.SetViewerCache(0,False)  
And now I can instantiate more than 30 viewers without 'getting into trouble'
I'm using the 6.2.4.0 version posted in this forum, which displays 'DEMO' on the viewer. Is there a way to get an official version of this library ?

Thanks
Dirk

Support

unread,
Sep 22, 2014, 10:27:56 PM9/22/14
to pdfne...@googlegroups.com

> which displays 'DEMO' on the viewer. Is there a way to get an official version of this library ?

You can obtain the license via https://www.pdftron.com/licensing
Reply all
Reply to author
Forward
0 new messages