Hi People,
I am using the Wx::RichText framework, which is more or less doing what I want from it, however, I'd like to create a PDF file from my RichTextBuffer.
There is a wxPdfDocument structure in wxWidgets, but it is unwrapped, so I thought it would be easier to use the Wx print framework instead.
The issue is that if I call the print dialogue everything works fine, and I can create a PDF with no problem, however (as I want it to be transparent to the user), when I do it bypassing the print dialogue, it doesn't work.
Code follows at end.
My question is:
As always, many thanks for your ideas.
Regards
Steve
my $loc_pdf_printdata = $self->{Ctl_RTC_Printing_Obj}->GetPrintData; $loc_pdf_printdata->SetOrientation( wxPORTRAIT ); $loc_pdf_printdata->SetNoCopies(1); $loc_pdf_printdata->SetPaperId( wxPAPER_A4 ); $loc_pdf_printdata->SetPrinterName("Virtual_PDF_Printer"); # This i +s the name of the Printer as it appears in cups on localhost:631. my $loc_printdialogdata = Wx::PrintDialogData->new(); $loc_printdialogdata->SetPrintData($loc_pdf_printdata); my $loc_pdf_printout = Wx::Printout->new("PDF Report"); my $loc_wxPrinter = Wx::Printer->new($loc_printdialogdata); my $loc_success = $loc_wxPrinter->Print( undef, $loc_pdf_printout, 0 + ); print $loc_success.";
# Print $loc_success returns "1".
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |