<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>29859</bug_id>
          
          <creation_ts>2009-09-29 05:44:15 -0700</creation_ts>
          <short_desc>[Qt] Emiting a signal for each page being printed</short_desc>
          <delta_ts>2009-11-24 07:53:17 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Printing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>26584</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt</keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tor Arne Vestbø">vestbo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hausmann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>150877</commentid>
    <comment_count>0</comment_count>
    <who name="Tor Arne Vestbø">vestbo</who>
    <bug_when>2009-09-29 05:44:15 -0700</bug_when>
    <thetext>This bug report originated from issue QTBUG-3568
http://bugreports.qt.nokia.com/browse/QTBUG-3568

--- Description ---

It would be nice if QtWebkit would emit a signal of each page being printed. This can be used both for user feedback, and for inserting headers and footers. A good name for this signal should obviously be invented. I have included a patch, that I use currently. 

patch:

diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index ae71356..574e14d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -955,10 +955,13 @@ void QWebFrame::print(QPrinter *printer) const
                     return;
                 }
                 printContext.spoolPage(ctx, page - 1, pageRect.width());
-                if (j &lt; pageCopies - 1)
+                if (j &lt; pageCopies - 1) {
+                    emit printingNewPage(printer,fromPage,toPage,page);
                     printer-&gt;newPage();
+                }
             }
-
+            emit printingNewPage(printer,fromPage,toPage,page);
+        
             if (page == toPage)
                 break;
 
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
index 18ae697..1d40a29 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -21,6 +21,8 @@
 #ifndef QWEBFRAME_H
 #define QWEBFRAME_H
 
+#define WKHTMLTOPDF_QT_WEBFRAME_PATCH
+
 #include &lt;QtCore/qobject.h&gt;
 #include &lt;QtCore/qurl.h&gt;
 #include &lt;QtCore/qvariant.h&gt;
@@ -191,6 +193,7 @@ Q_SIGNALS:
 
     void iconChanged();
 
+    void printingNewPage(QPrinter *p, int fromPage, int toPage, int Page) const;
 private:
     friend class QWebPage;
     friend class QWebPagePrivate;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166082</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2009-11-24 07:53:17 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 26584 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>