Documentation
¶
Index ¶
- type ConversionOptions
- type PDFGenerationAPIService
- func (s *PDFGenerationAPIService) GeneratePDF(ctx context.Context, templatePath string, outputPath string, ...) ([]byte, map[string]string, error)
- func (s *PDFGenerationAPIService) GeneratePDFWithOptions(ctx context.Context, options PDFGenerationOptions) ([]byte, map[string]string, error)
- func (s *PDFGenerationAPIService) GetSupportedEngines() []string
- func (s *PDFGenerationAPIService) GetSupportedFormats() []string
- func (s *PDFGenerationAPIService) GetTemplateVariables(templatePath string) ([]string, error)
- func (s *PDFGenerationAPIService) ValidateTemplate(templatePath string) error
- type PDFGenerationOptions
- func (o *PDFGenerationOptions) WithCleanup(enabled bool) *PDFGenerationOptions
- func (o *PDFGenerationOptions) WithConversion(enabled bool, formats ...string) *PDFGenerationOptions
- func (o *PDFGenerationOptions) WithDebug(enabled bool) *PDFGenerationOptions
- func (o *PDFGenerationOptions) WithEngine(engine string) *PDFGenerationOptions
- func (o *PDFGenerationOptions) WithTimeout(timeout time.Duration) *PDFGenerationOptions
- func (o *PDFGenerationOptions) WithVariable(key string, value interface{}) *PDFGenerationOptions
- func (o *PDFGenerationOptions) WithVariables(variables map[string]interface{}) *PDFGenerationOptions
- func (o *PDFGenerationOptions) WithVerbose(enabled bool) *PDFGenerationOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversionOptions ¶
ConversionOptions represents conversion options
type PDFGenerationAPIService ¶
type PDFGenerationAPIService struct {
// contains filtered or unexported fields
}
PDFGenerationAPIService provides a clean API for PDF generation
func NewPDFGenerationAPIService ¶
func NewPDFGenerationAPIService(cfg *config.Config) *PDFGenerationAPIService
NewPDFGenerationAPIService creates a new API service
func (*PDFGenerationAPIService) GeneratePDF ¶
func (s *PDFGenerationAPIService) GeneratePDF(ctx context.Context, templatePath string, outputPath string, variables map[string]interface{}) ([]byte, map[string]string, error)
GeneratePDF generates a PDF using the builder pattern
func (*PDFGenerationAPIService) GeneratePDFWithOptions ¶
func (s *PDFGenerationAPIService) GeneratePDFWithOptions(ctx context.Context, options PDFGenerationOptions) ([]byte, map[string]string, error)
GeneratePDFWithOptions generates a PDF with custom options
func (*PDFGenerationAPIService) GetSupportedEngines ¶
func (s *PDFGenerationAPIService) GetSupportedEngines() []string
GetSupportedEngines returns supported LaTeX engines
func (*PDFGenerationAPIService) GetSupportedFormats ¶
func (s *PDFGenerationAPIService) GetSupportedFormats() []string
GetSupportedFormats returns supported output formats
func (*PDFGenerationAPIService) GetTemplateVariables ¶
func (s *PDFGenerationAPIService) GetTemplateVariables(templatePath string) ([]string, error)
GetTemplateVariables extracts variables from a template
func (*PDFGenerationAPIService) ValidateTemplate ¶
func (s *PDFGenerationAPIService) ValidateTemplate(templatePath string) error
ValidateTemplate validates a template file
type PDFGenerationOptions ¶
type PDFGenerationOptions struct {
TemplatePath string
OutputPath string
Engine string
Variables map[string]interface{}
Conversion ConversionOptions
Cleanup bool
Timeout time.Duration
Verbose bool
Debug bool
}
PDFGenerationOptions represents options for PDF generation
func NewPDFGenerationOptions ¶
func NewPDFGenerationOptions(templatePath, outputPath string) *PDFGenerationOptions
NewPDFGenerationOptions creates new PDF generation options
func (*PDFGenerationOptions) WithCleanup ¶
func (o *PDFGenerationOptions) WithCleanup(enabled bool) *PDFGenerationOptions
WithCleanup enables cleanup
func (*PDFGenerationOptions) WithConversion ¶
func (o *PDFGenerationOptions) WithConversion(enabled bool, formats ...string) *PDFGenerationOptions
WithConversion enables conversion
func (*PDFGenerationOptions) WithDebug ¶
func (o *PDFGenerationOptions) WithDebug(enabled bool) *PDFGenerationOptions
WithDebug enables debug logging
func (*PDFGenerationOptions) WithEngine ¶
func (o *PDFGenerationOptions) WithEngine(engine string) *PDFGenerationOptions
WithEngine sets the LaTeX engine
func (*PDFGenerationOptions) WithTimeout ¶
func (o *PDFGenerationOptions) WithTimeout(timeout time.Duration) *PDFGenerationOptions
WithTimeout sets timeout
func (*PDFGenerationOptions) WithVariable ¶
func (o *PDFGenerationOptions) WithVariable(key string, value interface{}) *PDFGenerationOptions
WithVariable sets a variable
func (*PDFGenerationOptions) WithVariables ¶
func (o *PDFGenerationOptions) WithVariables(variables map[string]interface{}) *PDFGenerationOptions
WithVariables sets multiple variables
func (*PDFGenerationOptions) WithVerbose ¶
func (o *PDFGenerationOptions) WithVerbose(enabled bool) *PDFGenerationOptions
WithVerbose enables verbose logging