Trouble Shooting

<< Click to Display Table of Contents >>

Navigation:  Tasks >

Trouble Shooting

Important:

In case you decide to rename the DLL WPViewPDF04 ... do not choose a file name which contains "Demo04".

 

If the SaveToFile or CopyToClipboard function does not work for you, please check the setting of property SecurityOptions!

 

The flag wpDisableSave must not be set - if it is set once, saving cannot be enabled again!

 

Using the compiler switch IGNORE_SECOPT_IN_DFM it is possible with Delphi to disable that the property SecurityOptions is loaded from the DFM data. This makes it possible to set the property later in code.

 

 

a) Focus (Delphi / C++Builder)

 

Some special VCL controls, i.e. the TDrawGrid but not controls like TEdit, will not get the focus back from windows when WPViewPDF got it. So the mouse whell will still scroll the WPViewPDF window after the user click on the grid.

 

This is easy to fix. Please add a line of code in the Grid.OnClick or Grid.MouseUp event:

 

Windows.SetFocus(SomeGrid.Handle);

 

b) Unload DLL

 

Some developers have reported that their program would not unload when it is closed. This appears to be connected to 3rdparty components. To fix it You can call the global method WPPDFViewerStop in the OnClose of the main form.

 

c) Access Violation?

 

In case You use MadExcept please make sure to use the latest version of MadExcept. Otherwise it is possible that you see an Access Violation at address 0x000014 after the control was created.

 

d) File stays open after Form.Close

 

WPViewPDF was designed to keep the loaded PDF file in memory even if the window of the viewer was destroyed. The data will be released when the component is destroyed. This behaviour makes it possible to implement a docking feature.

 

e) To make sure the data is release when the form is closed (but not freed) call the method Clear or disable the compiler symbol ENABLE_WNDRECREATE in the file WPViewPDF3.PAS.

 

f) If pages in some PDF files appear to be blank, the JBIG2 decoding DLL was probably not loaded. The file wpdecodejp.dll must be copied for 32 bit, the file wpdecodejp64.dll for 64 bit projects.

 

g) With SetGlobalParameter("DisableThreading=1") multi threading can be disabled.

This should be done before the viewer window was created.

If highest possible stability is required, we recommend this setting.

 

h) In case the project remains in the process list after closing it:

 

The function wpdfSetGlobalParameter("StopIGDIPlus", 0) can be called before the DLL is unloaded to avoid trouble with GDI+ which under certain circumstances cannot be shutdown in the finalization of a DLL.

(The VCL however will automatically make this call before the FreeLibrary in "StopEngine".)

 

i) In case the memory consumption of the DLL is too high, SetGlobalParameter can be called with the parameter "MinimizeMemoryUsage=1". This will disable caching of the PDF page paths. Text selection is impossible in this case.

 

j) It is usually not required to call the command COMPDF_SetJBIG2Tool when the converter DLLs have been copied to the EXE directory.

The Command COMPDF_SetJBIG2Tool with an integer parameter 1 and the path as string parameter however can be used to manually load the decoding DLL.

It will return 1 if the DLL was loaded, 0 if not. With an integere parameter=2 it will unload the DLL. If the DLL was already loaded, it will not be loaded again. Please note, that in a 64bit process you need to load the 64bit DLL - the 32 bit DLL will not work.

 

k) Security forbids saving - if you get this message when you try to save a PDF file, the PDF or the component has the save function disabled. Please note, that once the property SecurityOptions was used to disable saving, it cannot be activated again. Please also check out the security commands and the Load&Save topic in the manual. Note: If a PDF was encrypted using AES256 it is not possible to lift the security.