Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2009-09

Printing with WebKit

13 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi,

I use qwebview to display pages Html in my application. This works fine, in Windows, Linux, Mac OSx (i386 and powerpc). But, when I want print the content of my qwebview, I have just a blank page, on Windows only.

This is the code I use:
qwebview_print(webview1.handle,webview1.hprinter);

where hprinter is :

hprinter := QPrinter_create();

Why the page is blank on printer?
Have any idea?

Thanks for your help.

Reply by email

zeljko
to Unknown author
Show quoted text 15 lines
Hi, I use qwebview to display pages Html in my application. This works fine, in Windows, Linux, Mac OSx (i386 and powerpc). But, when I want print the content of my qwebview, I have just a blank page, on Windows only. This is the code I use: qwebview_print(webview1.handle,webview1.hprinter); where hprinter is : hprinter := QPrinter_create(); Why the page is blank on printer? Have any idea?
What says QPrinter_isValid(), QPrinter_printerName(),
QPrinter_printProgram().. QPrinter_outputFormat() ?
eg:
hprinter .= QPrinter_create();
  QPrinter_isValid(hprinter);
  QPrinter_printerName(hprinter);
  QPrinter_outputFormat(hprinter);
  QPrinter_printProgram(hprinter);
  QPrinter_pageSize(hprinter);

Reply by email

aime two
to zeljko

Thanks for your time.

QPrinter_isValid returns : "true";
Qprinter_Printername returns the name of the printer I select with printdialog1.execute (Canon MP600R Printer)
I set PrinterOutputFormat with "QPrinterNativeformat" I set Printer PageSize to "0" (QPrinterA4)

Qprinter_PrintProgram returns : '' (empty string)

is this last thing my problem?

P.S. Sorry for my english....

zeljko a ?crit :

Show quoted text 37 lines
On Monday 07 September 2009 13:08, wrote: > Hi, > > I use qwebview to display pages Html in my application. This works fine, > in Windows, Linux, Mac OSx (i386 and powerpc). But, when I want print the > content of my qwebview, I have just a blank page, on Windows only. > > This is the code I use: > qwebview_print(webview1.handle,webview1.hprinter); > > where hprinter is : > > hprinter := QPrinter_create(); > > Why the page is blank on printer? > Have any idea? > What says QPrinter_isValid(), QPrinter_printerName(), QPrinter_printProgram().. QPrinter_outputFormat() ? eg: hprinter .= QPrinter_create(); QPrinter_isValid(hprinter); QPrinter_printerName(hprinter); QPrinter_outputFormat(hprinter); QPrinter_printProgram(hprinter); QPrinter_pageSize(hprinter); _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20090907/28c79a49/attachment.html>

Reply by email

zeljko
to aime two
aime two wrote 11 lines
Thanks for your time. QPrinter_isValid returns : "true"; Qprinter_Printername returns the name of the printer I select with printdialog1.execute (Canon MP600R Printer) I set PrinterOutputFormat with "QPrinterNativeformat" I set Printer PageSize to "0" (QPrinterA4) Qprinter_PrintProgram returns : '' (empty string) is this last thing my problem?

no, that's normal.
What is your OS and qt4 version ?

Reply by email

Unknown author
to zeljko
Show quoted text 16 lines
On Monday 07 September 2009 19:38, aime two wrote: > Thanks for your time. > > QPrinter_isValid returns : "true"; > Qprinter_Printername returns the name of the printer I select with > printdialog1.execute (Canon MP600R Printer) > I set PrinterOutputFormat with "QPrinterNativeformat" > I set Printer PageSize to "0" (QPrinterA4) > > Qprinter_PrintProgram returns : '' (empty string) > > is this last thing my problem? no, that's normal. What is your OS and qt4 version ?

Hello,
I have the same problem on "Windows Vista home edition" and "Windows XP Pro SP3", QT is QT4.5.2, with libqt4intf.dll from 04/20/2009 (on both boxes)

I test with "lazarus 0.9.26.2 FPC 2.2.2" and "lazarus 0.9.29 FPC 2.2.4"

Show quoted text 6 lines
_______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

Reply by email

aime two
to Unknown author

Hi,

Is someone has an idea about my problem when I try print with Qwebview on Windows?

Thx

a ?crit :

Show quoted text 44 lines
> On Monday 07 September 2009 19:38, aime two wrote: > >> Thanks for your time. >> >> QPrinter_isValid returns : "true"; >> Qprinter_Printername returns the name of the printer I select with >> printdialog1.execute (Canon MP600R Printer) >> I set PrinterOutputFormat with "QPrinterNativeformat" >> I set Printer PageSize to "0" (QPrinterA4) >> >> Qprinter_PrintProgram returns : '' (empty string) >> >> is this last thing my problem? >> > no, that's normal. > What is your OS and qt4 version ? > > Hello, I have the same problem on "Windows Vista home edition" and "Windows XP Pro SP3", QT is QT4.5.2, with libqt4intf.dll from 04/20/2009 (on both boxes) I test with "lazarus 0.9.26.2 FPC 2.2.2" and "lazarus 0.9.29 FPC 2.2.4" > _______________________________________________ > Qt mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/qt > > _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20090918/9aa66179/attachment.html>

Reply by email

Den Jean
to aime two
aime two wrote
Is someone has an idea about my problem when I try print with Qwebview on Windows?

I tested on windows and linux and it just works.

test code (lacks some *_destroys, just for testing purposes)

try
  PrnInfo:=QPrinterInfo_Create;
  QPrinterInfo_DefaultPrinter(PrnInfo);
  if QPrinterInfo_isNull(PrnInfo) then
    begin
    writeln('no printer found');
    exit;
    end;
  Prn:=QPrinter_Create(PrnInfo);
  QPrinterInfo_printerName(PrnInfo, at w);
  writeln('Default Printer Name:',w);
  PrintDlg:=QPrintDialog_create(Prn);
  QPrintDialog_exec(PrintDlg);
  QPrinter_printerName(QAbstractPrintDialog_printer(PrintDlg), at w);
  writeln('Chosen Printer Name:',w);
  QWebView_print(ActiveTab.WebView,QAbstractPrintDialog_printer(PrintDlg));
except on E:Exception do
  writeln('Exception occurred in FilePrint:',E.Message);
end;

Reply by email

aime two
to Den Jean

Hi
Thx,
I test that immediatly, and I say what.

Den Jean a ?crit :

Show quoted text 39 lines
On Friday 18 September 2009 16:52:09 aime two wrote: > Is someone has an idea about my problem when I try print with Qwebview > on Windows? > I tested on windows and linux and it just works. test code (lacks some *_destroys, just for testing purposes) try PrnInfo:=QPrinterInfo_Create; QPrinterInfo_DefaultPrinter(PrnInfo); if QPrinterInfo_isNull(PrnInfo) then begin writeln('no printer found'); exit; end; Prn:=QPrinter_Create(PrnInfo); QPrinterInfo_printerName(PrnInfo, at w); writeln('Default Printer Name:',w); PrintDlg:=QPrintDialog_create(Prn); QPrintDialog_exec(PrintDlg); QPrinter_printerName(QAbstractPrintDialog_printer(PrintDlg), at w); writeln('Chosen Printer Name:',w); QWebView_print(ActiveTab.WebView,QAbstractPrintDialog_printer(PrintDlg)); except on E:Exception do writeln('Exception occurred in FilePrint:',E.Message); end; _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20090924/0639bbca/attachment.html>

Reply by email

aime two
to Den Jean: I tested on windows and linux and it just works. test code (lacks some *_destroys, just…

Hi Den Jean,

I try with your code, but it dont work.
Can you add this print function in the project lclwebkit, try it on windows, and then put the new project on the net?

It's a good manier to ensure where is the problem for me.

(my english is very bad, I know. I hope you understand my message)

Regards,

Aime2Nice

(My nickname means "Aime of the city of "Nice", "Aime" is a name and "Nice" is a city of the French Riviera)

Den Jean a ?crit :

Show quoted text 39 lines
On Friday 18 September 2009 16:52:09 aime two wrote: > Is someone has an idea about my problem when I try print with Qwebview > on Windows? > I tested on windows and linux and it just works. test code (lacks some *_destroys, just for testing purposes) try PrnInfo:=QPrinterInfo_Create; QPrinterInfo_DefaultPrinter(PrnInfo); if QPrinterInfo_isNull(PrnInfo) then begin writeln('no printer found'); exit; end; Prn:=QPrinter_Create(PrnInfo); QPrinterInfo_printerName(PrnInfo, at w); writeln('Default Printer Name:',w); PrintDlg:=QPrintDialog_create(Prn); QPrintDialog_exec(PrintDlg); QPrinter_printerName(QAbstractPrintDialog_printer(PrintDlg), at w); writeln('Chosen Printer Name:',w); QWebView_print(ActiveTab.WebView,QAbstractPrintDialog_printer(PrintDlg)); except on E:Exception do writeln('Exception occurred in FilePrint:',E.Message); end; _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20090926/14e92a32/attachment.html>

Reply by email

aime two
to Den Jean

Hi,
Can I have the project whith the print option, to test it on my box? because that don't work for me...
Thanks in advance,

Aim?.

Den Jean a ?crit :

Show quoted text 13 lines
On Saturday 26 September 2009 12:30:38 aime two wrote: > Can you add this print function in the project lclwebkit, try it on > windows, and then put the new project on the net? > all done (it worked) _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20090929/97bc2124/attachment.html>

Reply by email

Den Jean
to aime two
aime two wrote
Can I have the project whith the print option, to test it on my box? because that don't work for me...

??

Show quoted text 8 lines
Thanks in advance, Aim?. Den Jean a ?crit : > On Saturday 26 September 2009 12:30:38 aime two wrote: > >> Can you add this print function in the project lclwebkit,

Done

>> try it on windows,

it worked

>> and then put the new project on the net?

Was done too: download again from webpage.
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

Demo is a zip file now. Clear your cache for this
page (hold shift, click reload on firefox)
if you do not see this text:

"Lazarus LCL/Qt WebKit demo
This is not meant to be full blown browser,
just basic usage demoes of cookies,proxy,authentication,flash ... Needs Binding >= V1.72 (lazarus svn 21913)
<LCL WebKit Demo>"

>> > all done (it worked)

Reply by email

Unknown author
to Den Jean

Hi,

Indeed, it works in lclwebkit, so I will make changes in my program. But But I do not have much time right now, is a lot of changes in my project.

But, I'll tell you when I could modify and test my project.

Thanks for your help.

Show quoted text 37 lines
On Tuesday 29 September 2009 19:03:41 aime two wrote: > Can I have the project whith the print option, to test it on my box? > because that don't work for me... ?? > Thanks in advance, > > Aim?. > > Den Jean a ?crit : > > On Saturday 26 September 2009 12:30:38 aime two wrote: > > > >> Can you add this print function in the project lclwebkit, Done > >> try it on windows, it worked > >> and then put the new project on the net? Was done too: download again from webpage. http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html Demo is a zip file now. Clear your cache for this page (hold shift, click reload on firefox) if you do not see this text: "Lazarus LCL/Qt WebKit demo This is not meant to be full blown browser, just basic usage demoes of cookies,proxy,authentication,flash ... Needs Binding >= V1.72 (lazarus svn 21913) <LCL WebKit Demo>" > >> > > all done (it worked) _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

Reply by email