C# Class Bloom.Publish.MakePdfUsingGeckofxHtmlToPdfProgram

This wrapper uses the GeckoFxHtmlToPdf program, which we rename to BloomPdfMaker.exe because AVG likes to quarantine it and we want to make it look less scary. Trying to use the component directly leads to obscure bugs, at least on Windows. Isolating the embedded Gecko browser in a separate process appears to at least let us produce the desired PDF files.
The program always seems to fail after it finishes while xulrunner is trying to clean up its COM objects. Running the program standalone reveals this on Linux by printing a scary SIGSEGV message and stack trace. On Windows, it brings up the "The Program Has Stopped Working" dialog which is even scarier. (I have seen the corresponding Linux dialog once after running this program.) However, the problem occurs after the desired output file has been safely written to the disk, and is nicely hidden away from the user by running it via CommandLineRunner.
Show file Open project: BloomBooks/BloomDesktop

Public Methods

Method Description
MakePdf ( string inputHtmlPath, string outputPdfPath, string paperSizeName, bool landscape, bool saveMemoryMode, Control owner, BackgroundWorker worker, DoWorkEventArgs doWorkEventArgs ) : void
SetArguments ( StringBuilder bldr, string inputHtmlPath, string outputPdfPath, string paperSizeName, bool landscape, bool saveMemoryMode ) : void

Private Methods

Method Description
GetNoDefaultPrinterErrorMessage ( ) : string

Method Details

MakePdf() public method

public MakePdf ( string inputHtmlPath, string outputPdfPath, string paperSizeName, bool landscape, bool saveMemoryMode, Control owner, BackgroundWorker worker, DoWorkEventArgs doWorkEventArgs ) : void
inputHtmlPath string
outputPdfPath string
paperSizeName string
landscape bool
saveMemoryMode bool
owner System.Windows.Forms.Control
worker System.ComponentModel.BackgroundWorker
doWorkEventArgs System.ComponentModel.DoWorkEventArgs
return void

SetArguments() public method

public SetArguments ( StringBuilder bldr, string inputHtmlPath, string outputPdfPath, string paperSizeName, bool landscape, bool saveMemoryMode ) : void
bldr StringBuilder
inputHtmlPath string
outputPdfPath string
paperSizeName string
landscape bool
saveMemoryMode bool
return void