sub ShowPrintPreview { my ($self, $event) = @_; # Printout class for HTML documents my $printout = Wx::HtmlEasyPrinting->new("Printing", $htmlwindow); # Get pointer to PageSetupDialogData instance my $psd = $printout->GetPageSetupData(); # Set the margins to fit the page $psd->SetMarginTopLeft([3,3]); $psd->SetMarginBottomRight([3,3]); # Preview the text $printout->PreviewText($htmlcontent); }