### Installation Directory Setup Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Configures installation directories for the application bundle. It sets the base installation prefix to be adjacent to the executable for easier running from Visual Studio. ```cmake set(BUILD_BUNDLE_DIR "$") set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") ``` -------------------------------- ### Configure Installation Bundle Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/linux/CMakeLists.txt Sets up the installation directory and cleans the bundle directory before each build. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() # Start with a clean build bundle directory every time. install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) ``` -------------------------------- ### Configure Installation Paths Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/windows/CMakeLists.txt Sets up installation directories and default build behavior for the Windows bundle. ```cmake # === Installation === # Support files are copied into place next to the executable, so that it can # run in place. This is done instead of making a separate bundle (as on Linux) # so that building and running from within Visual Studio will work. set(BUILD_BUNDLE_DIR "$") # Make the "install" step default, as it's required to run. set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") ``` -------------------------------- ### Install docx_file_viewer Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/README.md Add the dependency to your pubspec.yaml and install it. ```yaml dependencies: docx_file_viewer: ^1.0.1 ``` ```bash flutter pub get ``` -------------------------------- ### Install Application Files Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/linux/CMakeLists.txt Defines installation rules for the executable, ICU data, and Flutter libraries. ```cmake set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install docx_creator Package Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/README.md Add the docx_creator dependency to your pubspec.yaml file and run dart pub get to install. ```yaml dependencies: docx_creator: ^1.1.9 ``` ```bash dart pub get ``` -------------------------------- ### Define Installation Rules Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/windows/CMakeLists.txt Specifies files and directories to be installed, including runtime components, native assets, and Flutter assets. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Copy the native assets provided by the build.dart from all packages. set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Install Application Executable Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Installs the main application executable to the runtime destination. This component is marked as 'Runtime'. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Install Flutter Library Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Installs the main Flutter library file to the root of the application bundle's installation directory. This is required for the application to run and is part of the 'Runtime' component. ```cmake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install Application Bundle Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/example/linux/CMakeLists.txt Configures the installation of the Flutter application bundle, including cleaning the build directory, installing the executable, ICU data, libraries, and assets. This ensures a relocatable bundle is created in the build directory. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Install Plugins and Native Assets Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/linux/CMakeLists.txt Installs bundled plugin libraries and native assets provided by packages. ```cmake foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) # Copy the native assets provided by the build.dart from all packages. set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Bootstrap Workspace Source: https://github.com/alihassan143/flutter-packages/blob/main/README.md Links local packages and installs dependencies across the monorepo. ```bash melos bootstrap ``` -------------------------------- ### Generate a Full Document with Kitchen Sink Example Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md Demonstrates the full capabilities of the library, including HTML parsing, custom fonts, page layout, and complex elements like shapes and nested lists. ```dart import 'dart:io'; import 'package:docx_creator/docx_creator.dart'; Future kitchenSinkExample() async { // Load custom font final fontBytes = await File('fonts/Roboto.ttf').readAsBytes(); // Parse HTML content final htmlSection = await DocxParser.fromHtml('''

HTML Section

This is parsed from HTML.

FeatureStatus
Tables
Colors
'''); // Build complete document final doc = DocxDocumentBuilder() // Custom font .addFont('Roboto', fontBytes) // Section settings .section( orientation: DocxPageOrientation.portrait, pageSize: DocxPageSize.a4, backgroundColor: DocxColor('#FAFAFA'), header: DocxHeader(children: [ DocxParagraph.text('Company Report 2024', align: DocxAlign.right), ]), ) // Title .h1('Complete Document Example') .p('Demonstrating all docx_creator features.') // Text formatting .h2('Text Formatting') .add(DocxParagraph(children: [ DocxText('Bold, ', fontWeight: DocxFontWeight.bold), DocxText('Italic, ', fontStyle: DocxFontStyle.italic), DocxText('Color, ', color: DocxColor.red), DocxText('Highlight, ', highlight: DocxHighlight.yellow), DocxText('Custom Font', fontFamily: 'Roboto'), ])) // Nested list .h2('Complex Lists') .add(DocxList( style: DocxListStyle.disc, items: [ DocxListItem.text('Main Topic 1', level: 0), DocxListItem.text('Subtopic 1.1', level: 1), DocxListItem.text('Detail 1.1.1', level: 2), DocxListItem.text('Detail 1.1.2', level: 2), DocxListItem.text('Subtopic 1.2', level: 1), DocxListItem.text('Main Topic 2', level: 0), ], )) // Shapes .h2('Shapes & Drawings') .add(DocxParagraph(children: [ DocxShape.circle(diameter: 40, fillColor: DocxColor.red), DocxText(' '), DocxShape.star(points: 5, fillColor: DocxColor.gold), DocxText(' '), DocxShape.rightArrow(width: 60, height: 30, fillColor: DocxColor.blue), ])) // Page break before HTML section .pageBreak() .build(); // Add HTML section final elements = List.from(doc.elements); elements.addAll(htmlSection); // Create final document final finalDoc = DocxBuiltDocument( elements: elements, section: doc.section, fonts: doc.fonts, ); await DocxExporter().exportToFile(finalDoc, 'kitchen_sink.docx'); } ``` -------------------------------- ### Setup Flutter Tool Backend Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/windows/flutter/CMakeLists.txt Configures the custom command and target to trigger the Flutter tool build process. ```cmake # === Flutter tool backend === # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ${PHONY_OUTPUT} COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" ${FLUTTER_TARGET_PLATFORM} $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ) ``` -------------------------------- ### Install Melos CLI Source: https://github.com/alihassan143/flutter-packages/blob/main/README.md Global installation of the Melos tool required for managing the monorepo workspace. ```bash dart pub global activate melos ``` -------------------------------- ### Project and CMake Version Setup Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Sets the minimum required CMake version and the project name. Ensures compatibility with modern CMake features. ```cmake cmake_minimum_required(VERSION 3.14) project(docx_viewer_example LANGUAGES CXX) ``` -------------------------------- ### Install Flutter Assets Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Installs the Flutter assets directory. It first removes any existing assets to ensure a clean copy, then copies the assets from the build directory to the application's data directory. ```cmake set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install Bundled Plugin Libraries Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Installs any bundled plugin libraries to the application bundle's library directory. This is conditional on PLUGIN_BUNDLED_LIBRARIES being defined and is part of the 'Runtime' component. ```cmake if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Install AOT Library Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Installs the Ahead-Of-Time (AOT) compilation library to the application's data directory. This is done only for 'Profile' and 'Release' configurations to improve runtime performance. ```cmake install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Install Flutter Assets and AOT Library Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/linux/CMakeLists.txt Installs the Flutter assets directory and the AOT library for non-debug builds. ```cmake # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Install Native Assets Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Installs native assets provided by build.dart from all packages into the application bundle's library directory. This ensures all necessary native components are included. ```cmake set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Project and CMake Version Setup Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/example/windows/CMakeLists.txt Sets the minimum required CMake version and defines the project name and languages. Ensure your CMake version meets or exceeds 3.14. ```cmake cmake_minimum_required(VERSION 3.14) project(native_pdf_engine_example LANGUAGES CXX) ``` -------------------------------- ### Flutter PDF Generation Usage Example Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/README.md Demonstrates how to use the NativePdf class to convert HTML strings and URLs to PDF files or raw data. Includes error handling for each operation. ```dart import 'package:native_pdf_engine/native_pdf_engine.dart'; void main() async { // 1. Convert HTML String try { await NativePdf.convert( '

Hello World

This is a native PDF!

', 'output/path/document.pdf', ); print('PDF Generated!'); } catch (e) { print('Error: $e'); } // 2. Convert URL try { await NativePdf.convertUrl( 'https://flutter.dev', 'output/path/flutter_website.pdf', ); print('URL Captured!'); } catch (e) { print('Error: $e'); } // 3. Get PDF Data directly (HTML) try { final pdfData = await NativePdf.convertToData('

Direct Data

'); print('Got PDF Data: ${pdfData.length} bytes'); } catch (e) { print('Error: $e'); } // 4. Get PDF Data directly (URL) try { final pdfData = await NativePdf.convertUrlToData('https://dart.dev'); print('Got PDF Data: ${pdfData.length} bytes'); } catch (e) { print('Error: $e'); } } ``` -------------------------------- ### Ensure Color Contrast for Readability Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md When using foreground and background colors, ensure sufficient contrast for visibility. Examples show good and bad combinations. ```html Visible Visible Hard to read ``` -------------------------------- ### Initialize DocxView Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/README.md Basic initialization methods for loading DOCX files from different sources. ```dart import 'package:docx_file_viewer/docx_file_viewer.dart'; // From file DocxView.file(myFile) // From bytes DocxView.bytes(docxBytes) // From path DocxView.path('/path/to/document.docx') // With configuration DocxView( file: myFile, config: DocxViewConfig( enableSearch: true, enableZoom: true, pageMode: DocxPageMode.paged, theme: DocxViewTheme.light(), ), ) ``` -------------------------------- ### Initialize DocxView via Factory Constructors Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/DOCUMENTATION.md Alternative constructors for loading documents from different source types. ```dart // From File object DocxView.file(File file, {DocxViewConfig config, DocxSearchController? searchController}) // From raw bytes DocxView.bytes(Uint8List bytes, {DocxViewConfig config, DocxSearchController? searchController}) // From file path DocxView.path(String path, {DocxViewConfig config, DocxSearchController? searchController}) ``` -------------------------------- ### Basic Viewer Implementation Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/README.md Display a DOCX file within a Scaffold. ```dart Scaffold( body: DocxView.file( File('document.docx'), config: DocxViewConfig( enableZoom: true, backgroundColor: Colors.white, ), ), ) ``` -------------------------------- ### Markdown Nested List Export Example Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md This example shows how nested lists in Markdown are converted to OOXML multi-level numbering for DOCX export. ```markdown - Level 0 - Level 1 - Level 2 ``` -------------------------------- ### Project-level Configuration Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/example/linux/CMakeLists.txt Sets up the minimum CMake version, project name, and executable name. It also defines the application ID and opts into modern CMake behaviors. ```cmake cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) set(BINARY_NAME "native_pdf_engine_example") set(APPLICATION_ID "com.example.native_pdf_engine_example") cmake_policy(SET CMP0063 NEW) ``` -------------------------------- ### Install ICU Data File Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/windows/CMakeLists.txt Installs the ICU data file, which is necessary for international character support, to the data directory of the application bundle. This is part of the 'Runtime' component. ```cmake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Load DOCX Documents Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md Initialize a document from a file path or raw byte data. ```dart import 'dart:io'; import 'package:docx_creator/docx_creator.dart'; Future loadDocument() async { // Method 1: From file path final doc = await DocxReader.load('document.docx'); // Method 2: From bytes final bytes = await File('document.docx').readAsBytes(); final doc = await DocxReader.loadFromBytes(bytes); } ``` -------------------------------- ### Configure Flutter Windows Build Environment Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/windows/flutter/CMakeLists.txt Sets up the ephemeral directory, includes generated configurations, and defines the Flutter library and header paths. ```cmake cmake_minimum_required(VERSION 3.14) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") # Configuration provided via flutter tool. include(${EPHEMERAL_DIR}/generated_config.cmake) # TODO: Move the rest of this into files in ephemeral. See # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") # Set fallback configurations for older versions of the flutter tool. if (NOT DEFINED FLUTTER_TARGET_PLATFORM) set(FLUTTER_TARGET_PLATFORM "windows-x64") endif() # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "flutter_export.h" "flutter_windows.h" "flutter_messenger.h" "flutter_plugin_registrar.h" "flutter_texture_registrar.h" ) list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### CSS Named Colors Example Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/README.md Demonstration of using CSS named colors within HTML span tags. ```html DodgerBlue MediumVioletRed DarkOliveGreen PapayaWhip ``` -------------------------------- ### Download and Integrate WebView2 SDK Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/windows/CMakeLists.txt Downloads the Microsoft.Web.WebView2 NuGet package, extracts it, and configures the build to use its headers. Handles potential download failures. ```cmake # Download WebView2 NuGet package set(WEBVIEW2_VERSION "1.0.2210.55") set(WEBVIEW2_URL "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/${WEBVIEW2_VERSION}") set(WEBVIEW2_DIR "${CMAKE_CURRENT_BINARY_DIR}/webview2_package") if(NOT EXISTS "${WEBVIEW2_DIR}") message(STATUS "Downloading Microsoft.Web.WebView2.${WEBVIEW2_VERSION}...") file(DOWNLOAD "${WEBVIEW2_URL}" "${WEBVIEW2_DIR}/webview2.zip" STATUS DOWNLOAD_STATUS) list(GET DOWNLOAD_STATUS 0 STATUS_CODE) if(NOT STATUS_CODE EQUAL 0) message(FATAL_ERROR "Failed to download WebView2 package.") endif() file(ARCHIVE_EXTRACT INPUT "${WEBVIEW2_DIR}/webview2.zip" DESTINATION "${WEBVIEW2_DIR}") endif() ``` -------------------------------- ### Export DOCX Document to PDF Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/README.md Use PdfExporter to export a created DOCX document to a PDF file or get its byte representation. ```dart import 'package:docx_creator/docx_creator.dart'; // Create a document final doc = docx() .h1('PDF Export Demo') .p('This document will be exported to PDF.') .bullet(['Feature 1', 'Feature 2', 'Feature 3']) .build(); // Export to PDF file await PdfExporter().exportToFile(doc, 'output.pdf'); // Or get as bytes final pdfBytes = PdfExporter().exportToBytes(doc); ``` -------------------------------- ### Create and Style Tables in Docx Source: https://context7.com/alihassan143/flutter-packages/llms.txt Demonstrates creating both simple data-based tables and styled tables with custom formatting, including cell backgrounds and text styles. Ensure the docx_creator package is imported. ```dart import 'package:docx_creator/docx_creator.dart'; Future main() async { final doc = docx() // Simple table from data .table([ ['Name', 'Age', 'City'], ['Alice', '25', 'New York'], ['Bob', '30', 'Los Angeles'], ['Charlie', '35', 'Chicago'], ]) // Styled table with custom formatting .add(DocxTable( rows: [ // Header row DocxTableRow(cells: [ DocxTableCell( children: [DocxParagraph(children: [ DocxText('Product', fontWeight: DocxFontWeight.bold, color: DocxColor.white) ])], shadingFill: '4472C4', verticalAlign: DocxVerticalAlign.center, ), DocxTableCell( children: [DocxParagraph(children: [ DocxText('Price', fontWeight: DocxFontWeight.bold, color: DocxColor.white) ])], shadingFill: '4472C4', verticalAlign: DocxVerticalAlign.center, ), DocxTableCell( children: [DocxParagraph(children: [ DocxText('Stock', fontWeight: DocxFontWeight.bold, color: DocxColor.white) ])], shadingFill: '4472C4', verticalAlign: DocxVerticalAlign.center, ), ]), // Data rows with alternating colors DocxTableRow(cells: [ DocxTableCell( children: [DocxParagraph.text('Widget A')], shadingFill: 'F2F2F2', ), DocxTableCell( children: [DocxParagraph.text('$19.99')], shadingFill: 'F2F2F2', ), DocxTableCell( children: [DocxParagraph(children: [ DocxText('In Stock', color: DocxColor.green) ])], shadingFill: 'F2F2F2', ), ]), DocxTableRow(cells: [ DocxTableCell(children: [DocxParagraph.text('Widget B')]), DocxTableCell(children: [DocxParagraph.text('$29.99')]), DocxTableCell( children: [DocxParagraph(children: [ DocxText('Low Stock', color: DocxColor.orange) ])], ), ]), ], )) .build(); await DocxExporter().exportToFile(doc, 'tables_demo.docx'); } ``` -------------------------------- ### Find and Link GTK, GLIB, GIO Libraries (CMake) Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/example/linux/flutter/CMakeLists.txt Uses PkgConfig to find and check for GTK, GLIB, and GIO development files, making them available for linking. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) ``` -------------------------------- ### Initialize Flutter Build Rules Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/linux/CMakeLists.txt Includes the managed Flutter directory and checks for required system dependencies like GTK. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) ``` -------------------------------- ### Integrate with docx_creator Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/README.md Create a document using docx_creator and display it using DocxView. ```dart import 'package:docx_creator/docx_creator.dart'; import 'package:docx_file_viewer/docx_file_viewer.dart'; // Create a document final doc = docx() .h1('My Document') .p('This is a paragraph with some text.') .table([ ['Header 1', 'Header 2'], ['Cell 1', 'Cell 2'], ]) .build(); // Export to bytes final bytes = await DocxExporter().exportToBytes(doc); // View immediately DocxView.bytes(Uint8List.fromList(bytes)) ``` -------------------------------- ### Integrate DocxSearchController with TextField Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/DOCUMENTATION.md Example of integrating DocxSearchController with a TextField to enable document search. This includes handling user input, triggering searches, and displaying search result counts. ```dart class MyDocumentViewer extends StatefulWidget { @override _MyDocumentViewerState createState() => _MyDocumentViewerState(); } class _MyDocumentViewerState extends State { final _searchController = DocxSearchController(); final _textController = TextEditingController(); @override void dispose() { _searchController.dispose(); _textController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( children: [ // Custom search bar TextField( controller: _textController, onSubmitted: (value) => _searchController.search(value), decoration: InputDecoration( hintText: 'Search...', suffixIcon: Row( mainAxisSize: MainAxisSize.min, children: [ IconButton( icon: Icon(Icons.keyboard_arrow_up), onPressed: _searchController.previousMatch, ), IconButton( icon: Icon(Icons.keyboard_arrow_down), onPressed: _searchController.nextMatch, ), ListenableBuilder( listenable: _searchController, builder: (context, _) => Text( '${_searchController.currentMatchIndex + 1}/${_searchController.matchCount}', ), ), ], ), ), ), // Document view Expanded( child: DocxView.bytes( myDocxBytes, searchController: _searchController, ), ), ], ); } } ``` -------------------------------- ### Create a Simple DOCX Document Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/README.md Use the docx() builder to create a simple document with headings and paragraphs, then export it to a DOCX file. ```dart import 'package:docx_creator/docx_creator.dart'; void main() async { // Create a simple document final doc = docx() .h1('Hello, World!') .p('This is my first DOCX document.') .build(); // Save to file await DocxExporter().exportToFile(doc, 'hello.docx'); } ``` -------------------------------- ### Export Document to PDF Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md Shows how to create a document using the builder pattern and export it to a PDF file or byte array. ```dart import 'package:docx_creator/docx_creator.dart'; Future exportToPdf() async { // Create document final doc = docx() .h1('PDF Export Demo') .p('This document will be exported to PDF.') .build(); // Export to file await PdfExporter().exportToFile(doc, 'output.pdf'); // Or get as bytes final pdfBytes = PdfExporter().exportToBytes(doc); } ``` -------------------------------- ### SearchMatch Class Definition Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/DOCUMENTATION.md Represents a single occurrence of a search term within a document block. It includes the block index, start and end offsets within the block's text, and the matched text itself. ```dart class SearchMatch { final int blockIndex; // Block containing the match final int startOffset; // Start position in block text final int endOffset; // End position in block text final String text; // The matched text } ``` -------------------------------- ### Build Docx Sections Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/README.md Create a document with specific page orientation, size, and header/footer content. ```dart final doc = DocxDocumentBuilder() .section( orientation: DocxPageOrientation.portrait, pageSize: DocxPageSize.a4, backgroundColor: DocxColor('#F0F8FF'), header: DocxHeader(children: [ DocxParagraph.text('Company Name', align: DocxAlign.right), ]), footer: DocxFooter(children: [ DocxParagraph.text('Page 1', align: DocxAlign.center), ]), ) .h1('Document Title') .p('Content...') .build(); ``` -------------------------------- ### System-level Dependencies Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/example/linux/CMakeLists.txt Finds and checks for the PkgConfig tool and the gtk+-3.0 library. This is necessary for linking against GTK+ 3. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) ``` -------------------------------- ### Export DOCX to PDF with PdfExporter Source: https://context7.com/alihassan143/flutter-packages/llms.txt Shows how to export a built document to PDF, including creating documents from scratch, HTML, or Markdown. ```dart import 'package:docx_creator/docx_creator.dart'; Future main() async { // Create document using builder final doc = docx() .h1('PDF Export Demo') .p('This document will be exported to PDF.') .bullet(['Feature 1', 'Feature 2', 'Feature 3']) .table([ ['Item', 'Price', 'Qty'], ['Widget A', '$10', '5'], ['Widget B', '$15', '3'], ]) .build(); // Export to PDF file await PdfExporter().exportToFile(doc, 'output.pdf'); // Or get as bytes for streaming/upload final pdfBytes = PdfExporter().exportToBytes(doc); print('PDF size: ${pdfBytes.length} bytes'); // From HTML final htmlDoc = DocxBuiltDocument( elements: await DocxParser.fromHtml('

Title

Content

'), ); await PdfExporter().exportToFile(htmlDoc, 'from_html.pdf'); // From Markdown final mdDoc = DocxBuiltDocument( elements: await MarkdownParser.parse('# Title Paragraph'), ); await PdfExporter().exportToFile(mdDoc, 'from_markdown.pdf'); } ``` -------------------------------- ### Link Dependencies and Include Directories Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/example/windows/runner/CMakeLists.txt Links necessary libraries (flutter, flutter_wrapper_app, dwmapi.lib) and sets include directories for the application target. Add any application-specific dependencies here. ```cmake # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Copy WebView2Loader.dll to Output Directory Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/windows/CMakeLists.txt Adds a custom build command to copy the WebView2Loader.dll to the target's output directory after the build. This ensures the DLL is available at runtime. ```cmake # Copy WebView2Loader.dll to output directory add_custom_command(TARGET native_pdf_engine_windows POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${WEBVIEW2_DIR}/build/native/${WEBVIEW2_ARCH}/WebView2Loader.dll" "$" ) ``` -------------------------------- ### Directory Structure of docx_creator Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md Overview of the package's directory structure, highlighting key modules like AST nodes, builders, parsers, and exporters. ```tree docx_creator/ ├── lib/src/ │ ├── ast/ # Abstract Syntax Tree nodes │ │ ├── docx_node.dart # Base node & visitor │ │ ├── docx_block.dart # Block elements (paragraph) │ │ ├── docx_inline.dart # Inline elements (text, images) │ │ ├── docx_list.dart # List structures │ │ ├── docx_table.dart # Table structures │ │ ├── docx_drawing.dart # Shape/drawing elements │ │ ├── docx_image.dart # Image blocks │ │ └── docx_section.dart # Section properties │ ├── builder/ # Fluent API builder │ ├── core/ # Enums, colors, exceptions │ ├── exporters/ # DOCX/HTML exporters │ ├── parsers/ # HTML/Markdown parsers │ ├── reader/ # DOCX reader/editor │ └── utils/ # Image resolution, helpers ``` -------------------------------- ### Convert HTML to PDF (Legacy Engine) Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdfwidgets/README.md Use this snippet to convert basic HTML content to a PDF document using the default legacy engine. Ensure the 'htmltopdfwidgets' package is imported. ```dart import 'package:htmltopdfwidgets/htmltopdfwidgets.dart'; final htmlContent = '''

Heading Example

This is a paragraph.

Example Image
This is a quote.
  • First item
  • Second item
  • Third item
'''; var filePath = 'test/example.pdf'; var file = File(filePath); final newpdf = Document(); List widgets = await HTMLToPdf().convert(htmlContent); newpdf.addPage(MultiPage( maxPages: 200, build: (context) { return widgets; })); await file.writeAsBytes(await newpdf.save()); await file.writeAsBytes(await newpdf.save()); ``` -------------------------------- ### Export Document to PDF Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/CHANGELOG.md Demonstrates how to create a document and export it to a PDF file using the PdfExporter class. ```dart import 'package:docx_creator/docx_creator.dart'; final doc = docx().h1('Title').p('Content').build(); await PdfExporter().exportToFile(doc, 'output.pdf'); ``` -------------------------------- ### Convert PDF to DOCX Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md Shows how to load a PDF from a file path or bytes, check for parsing warnings, and export the resulting document structure to DOCX or PDF formats. ```dart import 'package:docx_creator/docx_creator.dart'; Future convertPdf() async { // Load from file path final pdf = await PdfReader.load('input.pdf'); // Or load from bytes final bytes = await File('input.pdf').readAsBytes(); final pdf = await PdfReader.loadFromBytes(bytes); // Check for warnings if (pdf.warnings.isNotEmpty) { print('Warnings: ${pdf.warnings.join('\n')}'); } // Convert to DOCX AST final doc = pdf.toDocx(); // Save as DOCX or PDF await DocxExporter().exportToFile(doc, 'converted.docx'); await PdfExporter().exportToFile(doc, 'converted.pdf'); } ``` -------------------------------- ### Configure Application Build and Output Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdf_syncfusion/example/linux/CMakeLists.txt Adds the runner subdirectory and sets the output directory for the executable to prevent running unbundled copies. ```cmake add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) # Only the install-generated bundle's copy of the executable will launch # correctly, since the resources must in the right relative locations. To avoid # people trying to run the unbundled copy, put it in a subdirectory instead of # the default top-level location. set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Apply Standard Build Settings Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/example/windows/runner/CMakeLists.txt Applies a standard set of build settings to the application target. This can be removed if custom build settings are required. ```cmake # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Define Native Library and Include Directories Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/native_pdf_engine/windows/CMakeLists.txt Defines the shared native library for Windows and specifies the include directory for its source files. Also sets up the include directory for the WebView2 SDK. ```cmake add_library(native_pdf_engine_windows SHARED "native_pdf_engine_windows.cpp" ) target_include_directories(native_pdf_engine_windows PRIVATE "include") ``` ```cmake target_include_directories(native_pdf_engine_windows PRIVATE "${WEBVIEW2_DIR}/build/native/include") ``` -------------------------------- ### Convert HTML to PDF (Browser Rendering Engine) Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/htmltopdfwidgets/README.md This snippet demonstrates converting HTML to PDF using the new browser rendering engine, which offers improved CSS support. Set `useNewEngine: true` to enable it. Ensure the 'htmltopdfwidgets' package is imported. ```dart import 'package:htmltopdfwidgets/htmltopdfwidgets.dart'; final htmlContent = '''

Hello Browser Engine

Supports bold, italic, and inline styles.

'''; // Enable the new engine with the useNewEngine flag final widgets = await HTMLToPdf().convert( htmlContent, useNewEngine: true, ); final newpdf = Document(); newpdf.addPage(MultiPage(build: (context) => widgets)); await File('browser_engine_example.pdf').writeAsBytes(await newpdf.save()); ``` -------------------------------- ### Generate PDFs with HtmlToPdf (Syncfusion) Source: https://context7.com/alihassan143/flutter-packages/llms.txt Shows conversion of HTML and Markdown to PDF, including appending content to existing Syncfusion PdfDocument instances. ```dart import 'dart:io'; import 'package:htmltopdf_syncfusion/htmltopdf_syncfusion.dart'; import 'package:syncfusion_flutter_pdf/pdf.dart'; Future main() async { // Simple HTML to PDF conversion const htmlContent = '''

Hello, PDF!

This is a paragraph with bold and italic text.

  • Item 1
  • Item 2
NameValue
A100
'''; final List bytes = await HtmlToPdf().convert(htmlContent); await File('simple_output.pdf').writeAsBytes(bytes); // Markdown to PDF with task lists const markdownContent = ''' # Project Tasks ## Completed - [x] Task 1 - Setup environment - [x] Task 2 - Create project ## Pending - [ ] Task 3 - Implement features - Nested item ## Table | Feature | Status | |---------|--------| | HTML | Done | | Markdown| Done | '''; final mdBytes = await HtmlToPdf().convertMarkdown(markdownContent); await File('markdown_output.pdf').writeAsBytes(mdBytes); // Advanced: Add to existing PdfDocument final document = PdfDocument(); // Add manual header document.pages.add().graphics.drawString( 'Document Header', PdfStandardFont(PdfFontFamily.helvetica, 18), ); const sectionHtml = '''

HTML Section

This content is added to an existing document.

Important quote here.
'''; // Convert and append to document await HtmlToPdf().convert(sectionHtml, targetDocument: document); // Save combined document final combinedBytes = await document.save(); document.dispose(); await File('combined.pdf').writeAsBytes(combinedBytes); } ``` -------------------------------- ### Implement DocxViewWithSearch Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/DOCUMENTATION.md A wrapper widget that provides a built-in search interface for the document viewer. ```dart DocxViewWithSearch( file: myFile, config: DocxViewConfig(enableSearch: true), ) ``` -------------------------------- ### Configure DocxViewTheme Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_file_viewer/README.md Define custom styling for document elements or use built-in light and dark presets. ```dart DocxViewTheme( backgroundColor: Colors.white, defaultTextStyle: TextStyle(fontSize: 14, color: Colors.black87, height: 1.5), headingStyles: { 1: TextStyle(fontSize: 28, fontWeight: FontWeight.bold), 2: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), 3: TextStyle(fontSize: 20, fontWeight: FontWeight.w600), 4: TextStyle(fontSize: 18, fontWeight: FontWeight.w600), 5: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), 6: TextStyle(fontSize: 14, fontWeight: FontWeight.w500), }, codeBlockBackground: Color(0xFFF5F5F5), codeTextStyle: TextStyle(fontFamily: 'monospace', fontSize: 13), blockquoteBackground: Color(0xFFF9F9F9), blockquoteBorderColor: Color(0xFFCCCCCC), tableBorderColor: Color(0xFFDDDDDD), tableHeaderBackground: Color(0xFFEEEEEE), linkStyle: TextStyle(color: Colors.blue, decoration: TextDecoration.underline), bulletColor: Color(0xFF333333), ) // Or use presets DocxViewTheme.light() DocxViewTheme.dark() ``` -------------------------------- ### Load DOCX Document from File Path Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/README.md Load an existing DOCX document by providing its file path to DocxReader.load. ```dart // From file path final doc = await DocxReader.load('existing.docx'); ``` -------------------------------- ### Markdown Tables Source: https://github.com/alihassan143/flutter-packages/blob/main/packages/docx_creator/DOCUMENTATION.md Illustrates the syntax for creating tables in Markdown, including headers, cells, and alignment options. ```markdown | Header 1 | Header 2 | Header 3 | |----------|----------|----------| | Cell 1 | Cell 2 | Cell 3 | | Cell 4 | Cell 5 | Cell 6 | # With alignment | Left | Center | Right | |:-----|:------:|------:| | L | C | R | ```