Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ul> tag doesn't adhere to inline styling like: "list-style-type: none; margin: 0; padding: 0;" #39

Open
michealgabriel opened this issue Oct 22, 2024 · 2 comments

Comments

@michealgabriel
Copy link

Hi there, i'm facing an issue with

    tag styling.

      List<String> lineSplits = content.split('\n');
      String data = "";
      for (var line in lineSplits) {
        data = "<li>$line</li>$data";
      }
    
      final htmlContent = '''
        <b style="font-size: 16px; margin-bottom: 5px;">Terms and Conditions</b>
        <ul style="font-size: 14px; list-style-type: none; margin: 0; padding: 0;">
        ${data}
        </ul>
      ''';
    
      final file = File('${directory.path}/$fileName');
      final newpdf = htmltopdfwidgets.Document();
      List<htmltopdfwidgets.Widget> widgets = await htmltopdfwidgets.HTMLToPdf().convert(htmlContent);
      newpdf.addPage(htmltopdfwidgets.MultiPage(
        maxPages: 200,
        build: (context) {
          return widgets;
        }
      ));
    
      await file.writeAsBytes(await newpdf.save());
    

    Please help look into this. Thanks.
    Nice package btw, found it suitable for my requirements. 👍

@michealgabriel
Copy link
Author

Hi again, haven't gotten a response yet.

@alihassan143
Copy link
Owner

sorry i am busy with other thing
currently inline padding and margins are not supported yet

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

No branches or pull requests

2 participants