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

Commit

Permalink
Adding support for interactive radio button inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcornewell authored and dcornewell committed Sep 9, 2021
1 parent b0c5856 commit c9c6ad6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lib/pdfconverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ void PdfConverterPrivate::spoolPage(int page) {
QString type = elm.attribute("type");
QString tn = elm.tagName();
QString name = elm.attribute("name");
QString value = elm.hasAttribute("value") ? elm.attribute("value") : "";
QStringList attributes = elm.attributeNames();
QMap<QString, QString> data;
foreach (const QString &attributeName, attributes) {
Expand Down Expand Up @@ -869,11 +870,19 @@ void PdfConverterPrivate::spoolPage(int page) {
elm.evaluateJavaScript("this.checked;").toBool(),
name,
elm.evaluateJavaScript("this.readOnly;").toBool());
} else if (type == "radio") {
painter->addRadioButton(
webPrinter->elementLocation(elm).second,
data,
elm.evaluateJavaScript("this.checked;").toBool(),
name,
value,
elm.evaluateJavaScript("this.readOnly;").toBool());
} else if (type == "hidden") {
painter->addHiddenField(
webPrinter->elementLocation(elm).second,
data,
elm.attribute("value"), name
value, name
);
} else if (tn == "SELECT") {
QWebElementCollection options = elm.findAll("option");
Expand Down

0 comments on commit c9c6ad6

Please sign in to comment.