This is a sample Flutter Web app that demonstrates how to generate and download PDF files using the Syncfusion_flutter_pdf package. The app allows the user to create a PDF document with custom content and download it to their device for offline use.
- Flutter version 3 or higher
- Syncfusion_flutter_pdf package (version 21.2.4 or higher)
- Clone this repository or download the ZIP file.
- Run
flutter pub getto install the required packages. - Run
flutter run -d chrometo launch the app in Chrome.
- In the app's home screen, you will see sample data displayed in a table format.
- Click on the floating action button to generate a PDF document with the table data and download it to your device.
- The downloaded PDF file will be saved in your device's default download directory.
- main.dart: The app's entry point, which sets up the UI and routes.
- customer_model.dart: A model class that defines the structure of a customer object and sample data list.
- pdf_service.dart: A class that encapsulates the PDF generation logic, such as creating a PDF document, adding pages, and download pdf file.
- table_screen.dart: A widget that displays the customer data in a table format.
If you have any feedback, suggestions, or issues, please feel free to create an issue or submit a pull request. We welcome all contributions!
This code is released under the MIT License. Feel free to use and modify the code for your own use.
