Hi,
if a document is created in memory (InMemoryMode = true) the pdf file is created if function EndDoc() is called.
If the file can't be created the exception EFCreateError is thrown. But this exception is not forwarded and can't be catched by the user's code:
Code
try
{ wPDF->EndDoc() ;
}catch (Exception &ex)
{
// Bug: Exception handler is not called if exception EFCreateError occurs in EndDoc()!!!}
On the other hand:
If the document is not created in memory (InMemoryMode = false) the pdf file is created if function BeginDoc() is called.
If the file can't be created the exception EFCreateError is thrown and forwarded as expected. It then can be catched by users code:
Code
try
{
wPDF->BeginDoc() ;
}
catch (Exception &ex)
{
// Ok: Exception handler is called if exception EFCreateError occurs in BeginDoc()!!!
}
This issue has been evaluated with wPDF V4.75.1 used by C++ Builder 10.3.1 Rio.
In my opinion it is a bug. Maybe it will be fixed in the next release of wPDF!?
Best regards
Michael