Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

[PATCH] fix for "HTML Input text controls doesn't print the value in PDF" #14

Closed
ornati opened this issue May 28, 2015 · 7 comments
Closed

Comments

@ornati
Copy link

ornati commented May 28, 2015

This little patch fixes:
wkhtmltopdf/wkhtmltopdf#2004
wkhtmltopdf/wkhtmltopdf#2005

There's also a typo "Parrent" vs "Parent" but I don't know if that affects anything ;)

diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index 4988df1..e668fcf 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -278,9 +278,17 @@ void QPdfEngine::addTextField(const QRectF &r, const QString &text, const QStrin
     char buf[256];
     QRectF rr = d->pageMatrix().mapRect(r);
     if (d->formFieldList == -1) d->formFieldList = d->requestObject();
+    /*
+     * http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf
+     *
+     * 12.5.3 Annotation Flags - bit 3:
+     * (PDF 1.2) If set, print the annotation when the page is printed. If clear,
+     * never print the annotation, regardless of whether it is displayed on the screen.
+     */
     d->xprintf("<<\n"
                "/Type /Annot\n"
-               "/Parrent %d 0 R\n"
+               "/F 4\n" // printable flag
+               "/Parent %d 0 R\n"
                "/Rect[", d->formFieldList);
     d->xprintf("%s ", qt_real_to_string(rr.left(),buf));
     d->xprintf("%s ", qt_real_to_string(rr.top(),buf));
@ashkulz
Copy link
Member

ashkulz commented Jun 5, 2015

@ornati: thanks for the fix, will merge it this weekend.

@shineblu
Copy link

shineblu commented Jun 5, 2015

Hi,

Before merging please see additional comments there - https://groups.google.com/forum/#!topic/wkhtmltopdf-general/ebivj97OFbU

Thanks

@blittle
Copy link

blittle commented Oct 26, 2015

Would love to see this merged and worked out.

@maxrb
Copy link

maxrb commented Nov 2, 2015

+1

@mchavarriagam
Copy link

Hi @ashkulz - Any update on this? I'm currently using 0.12.2.1 and ran into wkhtmltopdf/wkhtmltopdf#2005. Thanks! :)

@ashkulz
Copy link
Member

ashkulz commented Apr 28, 2016

Sorry for the long delay, but can someone create a patch for the /NeedAppearances true changes mentioned on the mailing list?

@ashkulz ashkulz closed this as completed in 6f3def4 May 6, 2016
@ashkulz
Copy link
Member

ashkulz commented May 6, 2016

This issue has been fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants