|
Enhanced EMF/WMF Metafile Support
Pregled
HotPDF zdaj zagotavlja bistveno izboljšano podporo za formata Enhanced Metafile (EMF) in Windows Metafile (WMF) Nova implementacija vključuje samodejno zaznavanje formata, več možnosti postavitve, napreden nadzor skaliranja in boljšo kakovost izrisa vektorske grafike v dokumentih PDF
Key Enhancements
- Automatic EMF/WMF format detection and appropriate processing
- Multiple positioning options (center, top-left, custom coordinates)
- Enhanced scaling and aspect ratio control
- Direct EMF rendering for vector graphics preservation
- Bitmap conversion option for compatibility
- Improved memory management for large metafiles
- Better handling of complex vector graphics and text
Možnosti nadzora položaja
Izboljšana podpora za metafile vključuje prilagodljive možnosti postavitve
- mpCenter: metafile je na sredini strani (privzeto vedenje)
- mpLeftTop: Metafile displayed at the top-left corner (X=0, Y=0)
- mpCustom: Metafile displayed at specified position (requires X, Y parameters)
Usage Examples
Basic Usage (Default Centered Display)
// Delphi example - Default centered display
procedure ShowMetafileDefault;
var
PDF: THotPDF;
MetaFile: TMetafile;
begin
PDF := THotPDF.Create(nil);
MetaFile := TMetafile.Create;
try
PDF.BeginDoc;
PDF.AddPage;
// Load metafile
MetaFile.LoadFromFile('diagram.emf');
// Display centered on page (default)
PDF.CurrentPage.ShowMetafile(MetaFile);
PDF.EndDoc;
finally
MetaFile.Free;
PDF.Free;
end;
end;
Position Control Usage
// Delphi example - Advanced positioning
procedure ShowMetafileAdvanced;
var
PDF: THotPDF;
MetaFile: TMetafile;
begin
PDF := THotPDF.Create(nil);
MetaFile := TMetafile.Create;
try
PDF.BeginDoc;
PDF.AddPage;
MetaFile.LoadFromFile('chart.wmf');
// Top-left corner display
PDF.CurrentPage.ShowMetafile(MetaFile, mpLeftTop);
// Custom position display
PDF.CurrentPage.ShowMetafile(MetaFile, mpCustom, 100, 200);
PDF.EndDoc;
finally
MetaFile.Free;
PDF.Free;
end;
end;
Izboljšane metode
Izboljšana podpora za EMF/WMF uvaja več novih metod
THPDFPage.ShowMetafile Overloads
ShowMetafile(MetaFile: TMetafile) - Default centered display
ShowMetafile(MetaFile: TMetafile; Position: THPDFMetafilePosition) - Position control
ShowMetafile(MetaFile: TMetafile; Position: THPDFMetafilePosition; X, Y: Single) - Custom positioning
Enhanced Processing Methods
EnhancedShowMetafile - Advanced processing with enhanced features
RenderEmfDirect - Direct EMF rendering for vector preservation
RenderEmfAsBitmap - Bitmap conversion for compatibility
RenderWmfAsBitmap - WMF bitmap rendering with position control
Tehnična izvedba
Izboljšana podpora za EMF/WMF je izvedena prek enote HPDFEmf.pas, ki ponuja
- THPDFEmfEnhanced: Core enhancement class for EMF processing
- THPDFEmfPatcher: Utility class for EMF conversion and rendering
- THPDFMetafilePosition: Enumeration for position control
- Enhanced EMF Record Processing: Support for advanced EMF records
Advanced Features
EMF Record Support
- EMR_BITBLT - Bitmap operations
- EMR_STRETCHDIBITS - Stretched bitmap operations
- EMR_ALPHABLEND - Alpha blending operations
- Enhanced text rendering
- Complex path operations
Rendering Options
- Vector Preservation: Maintains vector graphics quality
- Bitmap Fallback: Automatic fallback for complex graphics
- Scaling Options: Automatic and manual scaling control
- Quality Control: Configurable rendering quality settings
Performance Optimizations
- Memory-efficient processing for large metafiles
- Optimized EMF record parsing
- Intelligent caching for repeated elements
- Reduced memory footprint during conversion
Compatibility and Standards
- Windows EMF 1.0 and Enhanced EMF support
- Windows Metafile (WMF) backward compatibility
- Cross-platform rendering consistency
- PDF vector graphics standards compliance
Troubleshooting
Common Issues and Solutions:
- Large Metafiles: Use bitmap rendering for very large or complex metafiles
- Text Rendering: Ensure fonts are available on the target system
- Complex Graphics: Consider direct EMF rendering for better quality
- Positioning Issues: Use custom positioning for precise placement
Glejte tudi
|