Code Monkey home page Code Monkey logo

androidrtc's People

Contributors

lgyjg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

androidrtc's Issues

Unable to add Table in existing pdf page (Not as new page in pdf document ) in flutter

Iam trying add table in existing pdf page, but iam unable to add. (It is adding as new page in pdf document)

below is my code, please help me out in this scenario

final PdfDocument document =
PdfDocument(inputBytes: File(_file!.path).readAsBytesSync());

**final PdfPage pdfPage = document.pages[0];** // adding in first page

//Create a PdfGrid class
PdfGrid grid = PdfGrid();

//Add the columns to the grid
grid.columns.add(count: 3);

//Add header to the grid
// grid.headers.add(1);

//Add the rows to the grid
// PdfGridRow header = grid.headers[0];
// header.cells[0].value = 'Sign';
// header.cells[1].value = 'Sign';
// header.cells[2].value = 'Sign';

PdfGridRow row = grid.rows.add();
row.cells[0].value = 'Sign';
row.cells[1].value = 'Sign';
row.cells[2].value = 'Sign';

//Add rows to grid
PdfGridRow row1 = grid.rows.add();
row1.cells[0].value = 'xxxxxxx';
row1.cells[1].value = 'xxxxxxx';
row1.cells[2].value = 'xxxxxxxx';

PdfGridRow row2 = grid.rows.add();
row2.cells[0].value = 'Lead';
row2.cells[1].value = 'Manager';
row2.cells[2].value = 'Manager';

//Set the grid style
grid.style = PdfGridStyle(
cellPadding: PdfPaddings(left: 2, right: 3, top: 4, bottom: 5),
backgroundBrush: PdfBrushes.white,
textBrush: PdfBrushes.black,
font: PdfStandardFont(PdfFontFamily.helvetica, 25));

//Draw the grid
grid.draw(
page: pdfPage,
bounds: const Rect.fromLTWH(0, 0, 0, 0));

// grid.draw(page: page);


String tableFilePath = '/storage/emulated/0/Download/greensign_watermark_table.pdf';

//Save and dispose the PDF document
File(tableFilePath).writeAsBytes(await document.save());
document.dispose();

Iam getting runtime error as "E/flutter (16417): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.