PDF generator: console

Is it possible to use FNC PDF generator component in console applications with lazarus?

I tried but I got:
[FORMS.PP] ExceptionOccurred 
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000001001137FF line 91 of include/lclintf.inc
  $0000000100173BE9 line 252 of clipbrd.pp
  $0000000100176B40 line 4140 of LCLTMSFNCUtils.pas
  $0000000100010F01
  $000000010000317E line 99 of moleculestopdf.lpr
  $0000000100003206
  $0000000100017AC3
  $0000000100018411
  $00007FFA2BCC1FE4
  $00007FFA2BE8EF91
TApplication.HandleException Access violation
  Stack trace:
  $00000001001137FF
  $0000000100173BE9
  $0000000100176B40
  $0000000100010F01
  $000000010000317E
  $0000000100003206
  $0000000100017AC3
  $0000000100018411
  $00007FFA2BCC1FE4
  $00007FFA2BE8EF91
[FORMS.PP] ExceptionOccurred 

Hi, 


In the unit LCLTMSFNCUtils, it registers a clipboard format neccessary for clipboard support in various FNC UI controls. You can try to comment the code in the initialization section and see if you can compile the application.

Commenting lines 4140-4144 in LCLTMSFNCUtils:

  CF_FNCRICHTEXTSTREAM := RegisterClipboardFormat('RichEditorText');
  CF_FNCSTREAM := RegisterClipboardFormat('TTMSFNCClipBoard.StreamFormat');
  CF_FNCBITMAP := CF_PICTURE;
  CF_FNCRTF := RegisterClipboardFormat(TTMSFNCClipBoard.GetFormat(TTMSFNCClipBoardFormat.cfRTF));
  CF_FNCHTML := RegisterClipboardFormat(TTMSFNCClipBoard.GetFormat(TTMSFNCClipBoardFormat.cfHTML));

I am able to use pdf generator in a console application.
Is there a better solution than commenting? Since I use pdf generator both in CLI and GUI applications and I would prefer to not modify the FNC sources.

Hi, 


We'll investigate if we can add a conditional define to automatically control when clipboard formats are registered.

Thanks.