From 3effbbb3d38a2ac3b9cd8b12b34b93264c61750a Mon Sep 17 00:00:00 2001 From: Gaetano Savo Date: Tue, 15 Apr 2025 15:16:14 +0200 Subject: [PATCH] aggiunto PDFGenerator --- arm_PDFGenerator.md | 116 +++++++++++ arm_PDFGeneratorLetteraBenvenuto.md | 180 ++++++++++++++++++ ...GeneratorLetteraBenvenuto_vs_GestorePDF.md | 103 ++++++++++ 3 files changed, 399 insertions(+) create mode 100644 arm_PDFGenerator.md create mode 100644 arm_PDFGeneratorLetteraBenvenuto.md create mode 100644 arm_PDFGeneratorLetteraBenvenuto_vs_GestorePDF.md diff --git a/arm_PDFGenerator.md b/arm_PDFGenerator.md new file mode 100644 index 0000000..db16f74 --- /dev/null +++ b/arm_PDFGenerator.md @@ -0,0 +1,116 @@ +# PDFGenerator Documentation + +## Overview + +PDFGenerator is a core component that handles the generation of complex PDF documents. It provides a robust foundation for both GestorePDF and PDFGeneratorLetteraBenvenuto, offering advanced PDF rendering capabilities. + +## Core Features + +### Layout Management + +- Complex multi-section layouts +- A4 vertical and horizontal support +- Page margins and limits +- Custom headers and footers +- Automatic pagination + +### Supported Elements + +- Tables (`TablePDF`, `TablePDFEvolution`) +- Formatted text +- Images +- Geometric shapes (rectangles, circles) +- Lines +- Custom elements + +### Advanced Features + +- Automatic page breaks +- Page numbering +- Repeating headers/footers +- Index and table of contents +- Color profile management + +## Report Types + +1. **Base Reports** + - `Base_Proposta` + - `Unica_Diagnosi` + - `Unica_Monitoraggio` + - `Unica_Proposta` + +2. **Real Estate Reports** + - `Immobiliare_Diagnosi` + - `Immobiliare_Monitoraggio` + - `Immobiliare_MappaturaPreliminare` + - `Immobiliare_Finalita` + +3. **AMPRO Reports** + - `AMPRO_Semplificato` + - `AMPRO_Completo` + +## Technical Implementation + +### PDF Generation + +- Uses `ceTe.DynamicPDF` library +- ICC color profile support +- Professional print output intent +- Configuration via `ConfigurationManager.AppSettings` + +### Data Management + +- Multiple data source support +- Table data binding +- Conditional formatting +- ESG data support + +### Customization + +- Predefined report styles +- Customizable colors +- Configurable fonts and sizes +- Adaptive layouts + +## Component Integration + +### Used By + +1. **GestorePDF** + - Financial report generation + - Portfolio analysis + - Monitoring reports + +2. **PDFGeneratorLetteraBenvenuto** + - Client communication letters + - Welcome letters + - Commercial communications + +## Best Practices + +1. **Layout Design** + - Use predefined styles when possible + - Follow margin and limit guidelines + - Consider page breaks in data-heavy sections + +2. **Performance** + - Optimize image sizes + - Use appropriate color profiles + - Manage memory for large documents + +3. **Maintenance** + - Document custom styles + - Version control for templates + - Regular configuration review + +## Future Considerations + +1. **Enhancements** + - Additional element types + - Enhanced style management + - Improved memory handling + +2. **Integration** + - New report types + - Additional data sources + - Extended customization options diff --git a/arm_PDFGeneratorLetteraBenvenuto.md b/arm_PDFGeneratorLetteraBenvenuto.md new file mode 100644 index 0000000..5c9ffe5 --- /dev/null +++ b/arm_PDFGeneratorLetteraBenvenuto.md @@ -0,0 +1,180 @@ +# PDFGeneratorLetteraBenvenuto Documentation + +## Overview + +PDFGeneratorLetteraBenvenuto is a specialized component for generating various types of client communication letters in PDF format. It provides a flexible and configurable system for creating personalized letters for different business scenarios. + +## Architecture + +### Base Class + +#### LetteraBenvenuto + +- Core class for letter generation +- Manages common letter elements: + - Client data (name, surname, address) + - Header + - Letter body + - Signature + - Greetings + +### Letter Types + +1. **LetteraAccettazioneConAttivazioneSei** + - Purpose: SEI service activation acceptance letter + - Features: + - Location-based customization (e.g., "Milano, [date]" for network "W") + - Custom signature positioning + - Configurable layout + +2. **LetteraAccompagnamentoPeriodico** + - Purpose: Periodic report accompanying letter + - Features: + - Custom Y-axis bonus for greetings and signature + - Periodic report specific formatting + - Network-specific configurations + +3. **LetteraCommerciale** + - Purpose: Commercial communications + - Features: + - Page numbering support + - Custom formatting for commercial content + - Flexible layout options + +4. **LetteraRistampa** + - Purpose: Letter reprint management + - Features: + - Specific offset configurations + - Custom layout adjustments + - Height and width customization + +## Technical Implementation + +### PDF Generation + +- Uses `ceTe.DynamicPDF` library +- Components: + - Page Elements + - PDF Merger + - Text formatting + +### Configuration + +- Managed through `ConfigurationManager.AppSettings` +- Configurable elements: + - Font sizes + - Offset positions + - Template paths + - Color schemes + +### Template System + +- Manages multiple template types: + - Report templates + - Cover page templates + - Glossary templates + - Welcome letter templates +- Customizable properties: + - Font colors + - Chapter backgrounds + - Table headers + - Text formatting + +### Localization + +- Supports Italian culture settings +- Date formatting using `CultureInfo` +- Network-specific text customization + +## Data Sources + +### Database (SqlServerStampeC6) + +1. **Main Stored Procedures**: + - `[C6MartPeriodico].[GESTIONE_SELECT_LETTERE_DA_INVIARE]` - periodic letters + - `[C6Mart].[GESTIONE_SELECT_LETTERE_DA_INVIARE]` - standard letters + - `dbo.GetPDFTemplateConfiguration_Rosaspina` - template configurations + +2. **Letter Input Parameters**: + - Network (Rete) + - ID + - Client Name and Surname + - Address + - Title/Form of Address + - Subject + - Signature + - Contract Type + +3. **Configuration (App.config)**: + - Database connection string + - Formatting parameters + - Offset and positioning settings + +### GestoreLettera Component + +Manages data retrieval and processing: + +- Database interaction +- Error handling +- Logging +- Letter type-specific queries + +## Data Flow + +1. Letter generation request with base parameters +2. `GestoreLettera` retrieves specific data from database +3. Template configuration retrieval via `GetPDFTemplateConfiguration_Rosaspina` +4. Data application to appropriate template +5. Custom formatting and positioning +6. PDF generation and output + +## Configuration Parameters + +Key configuration settings: + +- `fontSize`: Font size for text elements +- `OffsetFirmaAttivazioneSei`: Signature positioning for SEI activation +- `OffSetLetteraRistampaCliente`: Client info positioning for reprints +- `OffsetLetteraRistampaSaluti`: Greeting positioning for reprints + +## Integration Points + +1. **Database** + - Uses `DataAccessDE` with `DBProvider.SqlServerStampeC6` + - Template configuration retrieval + - Client data access + +2. **File System** + - Template file storage + - Generated PDF output + - Configuration files + +## Best Practices + +1. **Template Management** + - Keep templates in designated folders + - Use consistent naming conventions + - Maintain version control + +2. **Configuration** + - Document all configuration parameters + - Test layout changes in all letter types + - Validate offset values + +3. **Error Handling** + - Validate all input parameters + - Handle missing templates gracefully + - Log generation errors + +## Future Considerations + +1. **Enhancement Opportunities** + - Additional letter types + - Enhanced template customization + - Improved error handling + - Performance optimization + +2. **Maintenance** + - Regular template updates + - Configuration review + - Performance monitoring diff --git a/arm_PDFGeneratorLetteraBenvenuto_vs_GestorePDF.md b/arm_PDFGeneratorLetteraBenvenuto_vs_GestorePDF.md new file mode 100644 index 0000000..7c39cf6 --- /dev/null +++ b/arm_PDFGeneratorLetteraBenvenuto_vs_GestorePDF.md @@ -0,0 +1,103 @@ +# PDFGeneratorLetteraBenvenuto vs GestorePDF Comparison + +## Purpose + +### GestorePDF + +- Generates financial analysis and monitoring reports +- Focuses on financial data and portfolio analysis +- Handles "DIAGNOSI" and "MONITORAGGIO" reports + +### PDFGeneratorLetteraBenvenuto + +- Generates client communication letters +- Focuses on formal correspondence +- Handles various letter types (welcome, commercial, periodic) + +## Data Structure + +### GestorePDF + +- Uses `DataThread` for processing data +- Works with complex financial data +- XML templates for report sections + +### PDFGeneratorLetteraBenvenuto + +- Uses simple parameters (name, address, etc.) +- Correspondence-oriented data structure +- PDF templates for letter layouts + +## Template System + +### GestorePDF + +- XML templates (`TemplateGenerator.xml`) +- Dynamic sections for financial data +- Support for complex charts and tables + +### PDFGeneratorLetteraBenvenuto + +- Pre-formatted PDF templates +- Fixed layout with variable areas +- Focus on text and signature positioning + +## Database Usage + +### GestorePDF + +- Financial data stored procedures +- `c6martPeriodico.UpdateStatoReport` +- `GESTIONE_PDF_PREPARE_TEST_SAMPLE` + +### PDFGeneratorLetteraBenvenuto + +- Letter management stored procedures +- `GESTIONE_SELECT_LETTERE_DA_INVIARE` +- `GetPDFTemplateConfiguration_Rosaspina` + +## Processing + +### GestorePDF + +- Multi-threaded processing +- Queue management +- Parallel report processing + +### PDFGeneratorLetteraBenvenuto + +- Single letter processing +- Sequential handling +- Focus on formatting and layout + +## Output + +### GestorePDF + +- Complex financial reports +- Detailed charts and analysis +- Multiple report sections + +### PDFGeneratorLetteraBenvenuto + +- Formal letters +- Standardized layout +- Client-specific content + +## Integration + +### GestorePDF + +- Part of financial analysis system +- Trading system integration +- Processing status management + +### PDFGeneratorLetteraBenvenuto + +- Client communication system +- CRM integration +- Correspondence management + +## Summary + +While GestorePDF specializes in generating complex financial reports with detailed analysis, PDFGeneratorLetteraBenvenuto focuses on generating formal client communications. They have different purposes, architectures, and processing methods, despite using the same underlying database.