alihassan143 / htmltopdfwidgets

Html To Pdf
https://pub.dev/packages/htmltopdfwidgets
Apache License 2.0
12 stars 18 forks source link

add feature #6

Open PRQAE opened 1 year ago

PRQAE commented 1 year ago

hi, thank you for the plugin.

can you add classes, like to use conditions for the classes, ex:

import 'dart:io'; import 'package:htmltopdfwidgets/htmltopdfwidgets.dart';

void main() { createDocument(); }

boolean signedin = true; const htmlText = '''<p style=" signedin == true "green;" ? "red;" "> status

"''';

createDocument() async { var filePath = 'example.pdf'; var file = File(filePath); final newpdf = Document(); List widgets = await HTMLToPdf().convert(htmlText); newpdf.addPage(MultiPage( maxPages: 200, build: (context) { return widgets; })); await file.writeAsBytes(await newpdf.save()); }

alihassan143 commented 1 year ago

@PRQAE sure i will work on that and will implement that feature if you have time and you can implement that feature and submit a pr

vasanthmn1 commented 4 months ago

@alihassan143 You implement CSS class in this plugin