input

package
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter added in v2.1.0

type Converter struct {
	Input
	// contains filtered or unexported fields
}

Represents the base class for inputs.

func (*Converter) BottomMargin added in v2.1.0

func (p *Converter) BottomMargin() float32

Gets the BottomMargin.

func (*Converter) InchesToPoints added in v2.1.0

func (p *Converter) InchesToPoints(size float32) float32

func (*Converter) LeftMargin added in v2.1.0

func (p *Converter) LeftMargin() float32

Gets the LeftMargin.

func (*Converter) MillimetersToPoints added in v2.1.0

func (p *Converter) MillimetersToPoints(size float32) float32

func (*Converter) PageHeight added in v2.1.0

func (p *Converter) PageHeight() float32

Gets the PageHeight.

func (*Converter) PageOrientation added in v2.1.0

func (p *Converter) PageOrientation() Orientation

Gets the PageOrientation.

func (*Converter) PageSize added in v2.1.0

func (p *Converter) PageSize() PageSize

Gets the PageSize.

func (*Converter) PageWidth added in v2.1.0

func (p *Converter) PageWidth() float32

Gets the pageWidth.

func (*Converter) RightMargin added in v2.1.0

func (p *Converter) RightMargin() float32

Gets the RightMargin.

func (*Converter) SetBottomMargin added in v2.1.0

func (p *Converter) SetBottomMargin(value float32)

sets the BottomMargin.

func (*Converter) SetLeftMargin added in v2.1.0

func (p *Converter) SetLeftMargin(value float32)

sets the LeftMargin.

func (*Converter) SetPageHeight added in v2.1.0

func (p *Converter) SetPageHeight(value float32)

sets the PageHeight.

func (*Converter) SetPageOrientation added in v2.1.0

func (p *Converter) SetPageOrientation(value Orientation)

sets the PageOrientation.

func (*Converter) SetPageSize added in v2.1.0

func (p *Converter) SetPageSize(value PageSize)

sets the PageSize.

func (*Converter) SetPageWidth added in v2.1.0

func (p *Converter) SetPageWidth(value float32)

sets the pageWidth.

func (*Converter) SetRightMargin added in v2.1.0

func (p *Converter) SetRightMargin(value float32)

sets the RightMargin.

func (*Converter) SetTopMargin added in v2.1.0

func (p *Converter) SetTopMargin(value float32)

sets the TopMargin.

func (*Converter) TopMargin added in v2.1.0

func (p *Converter) TopMargin() float32

Gets the TopMargin.

type Dlex

type Dlex struct {
	Input
}

Represents a Dlex input.

func NewDlexWithCloudResourceNLayoutData

func NewDlexWithCloudResourceNLayoutData(cloudResourcePath string, layoutData resource.LayoutDataResource) *Dlex
Initializes a new instance of the `DlexInput` class by posting the

DLEX file and the JSON data file or DLEX file path that is present in the cloud environment and the JSON data file or DLEX file path and DLEX data file path that is present in the cloud environment from the client to the API to create the PDF report.

  • @param {string}The DLEX file path present in the resource manager.
  • @param {LayoutDataResource} layoutData json data file used to create the PDF report.

func NewDlexWithCloudResourceNLayoutDataPath

func NewDlexWithCloudResourceNLayoutDataPath(cloudResourcePath string, layoutData string) *Dlex
Initializes a new instance of the `DlexInput` class by posting the

DLEX file and the JSON data file or DLEX file path that is present in the cloud environment and the JSON data file or DLEX file path and DLEX data file path that is present in the cloud environment from the client to the API to create the PDF report.

  • @param {string} The DLEX file path present in the resource manager.
  • @param {string} The JSON data file path present in the resource manager used to create the PDF report.

func NewDlexWithDlexNLayoutResources

func NewDlexWithDlexNLayoutResources(dlexResource resource.DlexResource, layoutData resource.LayoutDataResource) *Dlex
Initializes a new instance of the `DlexInput` class by posting the

DLEX file and the JSON data file or DLEX file path that is present in the cloud environment and the JSON data file or DLEX file path and DLEX data file path that is present in the cloud environment from the client to the API to create the PDF report.

  • @param {DlexResource} resource dlex file created as per the desired PDF report layout design.
  • @param {LayoutDataResource} layoutData json data file used to create the PDF report.

func NewDlexWithDlexResourceNLayoutDataPath

func NewDlexWithDlexResourceNLayoutDataPath(dlexResource resource.DlexResource, layoutData string) *Dlex
Initializes a new instance of the `DlexInput` class by posting the

DLEX file and the JSON data file or DLEX file path that is present in the cloud environment and the JSON data file or DLEX file path and DLEX data file path that is present in the cloud environment from the client to the API to create the PDF report.

  • @param {DlexResource} resource dlex file created as per the desired PDF report layout design.
  • @param {string} The JSON data file path present in the resource manager used to create the PDF report.

func (*Dlex) InputType

func (p *Dlex) InputType() InputType

type Excel added in v2.1.0

type Excel struct {
	Converter
}

Represents a Excel input.

func NewExcelInputWithResource added in v2.1.0

func NewExcelInputWithResource(resources resource.ExcelResource) *Excel

Initializes a new instance of the `ExcelInput` class.

  • @param { string} input The Excel embeded as a string.

func (*Excel) InputType added in v2.1.0

func (p *Excel) InputType() InputType

func (*Excel) Resources added in v2.1.0

func (p *Excel) Resources() []resource.Resource

type Html

type Html struct {
	Converter
}

Represents a HTML input.

func NewHtmlInputWithResource

func NewHtmlInputWithResource(resource resource.HtmlResource) *Html

Initializes a new instance of the `HTMLInput` class.

  • @param { string} input The html embeded as a string.

func NewHtmlInputWithString

func NewHtmlInputWithString(inputString string) *Html

Initializes a new instance of the `HTMLInput` class.

  • @param { string} input The html embeded as a string.

func (*Html) BasePath

func (p *Html) BasePath() string

Gets the BasePath.

func (*Html) InputType

func (p *Html) InputType() InputType

func (*Html) Resources

func (p *Html) Resources() []resource.Resource

func (*Html) SetBasePath

func (p *Html) SetBasePath(value string)

sets the BasePath.

type Image

type Image struct {
	Input
}

Represents an image input.

func NewImageWithResourcePath

func NewImageWithResourcePath(value string) *Image

Initializes a new instance of the `ImageInput` class.

  • @param {string} resource object to create ImageInput. | The image file path present in cloud resource manager.

func NewImagewithImageResource

func NewImagewithImageResource(value resource.ImageResource) *Image

Initializes a new instance of the `ImageInput` class.

  • @param {ImageResource} resource object to create ImageInput. | The image file path present in cloud resource manager.

func (*Image) BottomMargin

func (p *Image) BottomMargin() float32

Gets the BottomMargin.

func (*Image) InputType

func (p *Image) InputType() InputType

func (*Image) LeftMargin

func (p *Image) LeftMargin() float32

Gets the LeftMargin.

func (*Image) PageHeight

func (p *Image) PageHeight() float32

Gets the PageHeight.

func (*Image) PageWidth

func (p *Image) PageWidth() float32

Gets the pageWidth.

func (*Image) RightMargin

func (p *Image) RightMargin() float32

Gets the RightMargin.

func (*Image) SetBottomMargin

func (p *Image) SetBottomMargin(value float32)

sets the BottomMargin.

func (*Image) SetLeftMargin

func (p *Image) SetLeftMargin(value float32)

sets the LeftMargin.

func (*Image) SetPageHeight

func (p *Image) SetPageHeight(value float32)

sets the PageHeight.

func (*Image) SetPageWidth

func (p *Image) SetPageWidth(value float32)

sets the pageWidth.

func (*Image) SetRightMargin

func (p *Image) SetRightMargin(value float32)

sets the RightMargin.

func (*Image) SetTopMargin

func (p *Image) SetTopMargin(value float32)

sets the TopMargin.

func (*Image) TopMargin

func (p *Image) TopMargin() float32

Gets the TopMargin.

type Input

type Input struct {
	InputCollector `json:"-"`

	ResourceName string `json:"resourceName,omitempty"`

	Elements               []element.ElementCollector `json:"elements,omitempty"`
	LayoutDataResourceName string                     `json:"layoutDataResourceName,omitempty"`

	TextReplace []TextReplace `json:"textReplace,omitempty"`

	ScaleX      float32         `json:"scaleX,omitempty"`
	ScaleY      float32         `json:"scaleY,omitempty"`
	VAlign      position.VAlign `json:"vAlign,omitempty"`
	Align       position.Align  `json:"align,omitempty"`
	ExpandToFit bool            `json:"expandToFit,omitempty"`
	ShrinkToFit bool            `json:"shrinkToFit,omitempty"`
	StartPage   int             `json:"startPage,omitempty"`
	PageCount   int             `json:"pageCount,omitempty"`    /*TODO:Nullability*/
	MergeOption MergeOptions    `json:"mergeOptions,omitempty"` /*TODO:Type*/
	// contains filtered or unexported fields
}

func (*Input) Element

func (p *Input) Element() []element.ElementCollector

func (*Input) Id

func (p *Input) Id() string

func (*Input) MarshalJSON

func (p *Input) MarshalJSON() ([]byte, error)

func (*Input) Resources

func (p *Input) Resources() []resource.Resource

func (*Input) SetId

func (p *Input) SetId(value string)

func (*Input) SetTemplate

func (p *Input) SetTemplate(temp element.Template)

Sets the template.

func (*Input) Template

func (p *Input) Template() element.Template

Gets the template.

type InputCollector

type InputCollector interface {
	InputType() InputType
	Template() element.Template
	Resources() []resource.Resource
	Element() []element.ElementCollector
}

Represents the base class for inputs.

type InputType

type InputType string
const (

	// Dlex input.
	DlexInput InputType = "dlex"

	// Pdf input.
	PdfInput InputType = "pdf"

	// Image input.
	ImageInput InputType = "image"

	// Page input.
	PageInput InputType = "page"

	// Html input.
	HtmlInput InputType = "html"

	//Word input
	WordInput InputType = "word"

	//Excel input
	ExcelInput InputType = "excel"
)

Specifies horizontal alignment. Center alignment is the default value for alignments.

type MergeOptions

type MergeOptions struct {

	/* Gets or sets a boolean indicating whether to import document information when merging. */
	DocumentInfo *bool `json:"documentInfo,omitempty"`

	// Gets or sets a boolean indicating whether to import document level JavaScript when merging.
	DocumentJavaScript *bool `json:"documentJavaScript,omitempty"`

	// Gets or sets a boolean indicating whether to import document properties when merging.
	DocumentProperties *bool `json:"documentProperties,omitempty"`

	// Gets or sets a boolean indicating whether to import embedded files when merging.
	EmbeddedFiles *bool `json:"embeddedFiles,omitempty"`

	// Gets or sets a boolean indicating whether to import form fields when merging.
	FormFields *bool `json:"formFields,omitempty"`

	// Gets or sets a boolean indicating whether to import XFA form data when merging.
	FormsXfaData *bool `json:"formsXfaData,omitempty"`

	// Gets or sets a boolean indicating whether to import logical structure (tagging information) when merging.
	LogicalStructure *bool `json:"logicalStructure,omitempty"`

	// Gets or sets a boolean indicating whether to import document's opening action (initial page and zoom settings) when merging.
	OpenAction *bool `json:"openAction,omitempty"`

	// Gets or sets a boolean indicating whether to import optional content when merging.
	OptionalContentInfo *bool `json:"optionalContentInfo,omitempty"`

	// Gets or sets a boolean indicating whether to import outlines and bookmarks when merging.
	Outlines *bool `json:"outlines,omitempty"`

	// Gets or sets a boolean indicating whether to import OutputIntent when merging.
	OutputIntent *bool `json:"outputIntent,omitempty"`

	// Gets or sets a boolean indicating whether to import PageAnnotations when merging.
	PageAnnotations *bool `json:"pageAnnotations,omitempty"`

	// Gets or sets a boolean indicating whether to import PageLabelsAndSections when merging.
	PageLabelsAndSections *bool `json:"pageLabelsAndSections,omitempty"`

	/*
		Gets or sets the root form field for imported form fields.
		Useful when merging a PDF repeatedly to have a better
		control on the form field names.
	*/
	RootFormField string `json:"rootFormField,omitempty"`

	// Gets or sets a boolean indicating whether to import XmpMetadata when merging.
	XmpMetadata *bool `json:"xmpMetadata,omitempty"`
}

Represents different options for merging PDF documents.

func NewMergeOptions

func NewMergeOptions() MergeOptions

type Orientation

type Orientation int
const (

	// Portrait Page Orientation
	Portrait Orientation = 0

	// Landscape Page Orientation
	Landscape Orientation = 1
)

Represents Page Orientation.

type Page

type Page struct {
	Input
	// contains filtered or unexported fields
}

Represents a page input.

func NewPage

func NewPage() *Page

func NewPageWithDimension

func NewPageWithDimension(width float32, height float32) *Page

Initializes a new instance of the `PageInput` class.

  • @param {float} pageWidth The width of the page.
  • @param {float} pageHeight The height of the page.

func NewPageWithSizeAndOrientation added in v2.1.2

func NewPageWithSizeAndOrientation(pageSize PageSize, pageOrientation Orientation, margins float32) *Page

Initializes a new instance of the `PageInput` class.

  • @param {PageSize} pageSize The size of the page.
  • @param {Orientation} Orientation The orientation of the page.
  • @param {float32} margins The margins of the page.

func (*Page) BottomMargin

func (p *Page) BottomMargin() float32

Gets the BottomMargin.

func (*Page) Element

func (p *Page) Element() []element.ElementCollector

func (*Page) InchesToPoints

func (p *Page) InchesToPoints(size float32) float32

func (*Page) InputType

func (p *Page) InputType() InputType

func (*Page) LeftMargin

func (p *Page) LeftMargin() float32

Gets the LeftMargin.

func (Page) MarshalJSON

func (p Page) MarshalJSON() ([]byte, error)

func (*Page) MillimetersToPoints

func (p *Page) MillimetersToPoints(size float32) float32

func (*Page) PageHeight

func (p *Page) PageHeight() float32

Gets the page height.

func (*Page) PageOrientation

func (p *Page) PageOrientation() Orientation

Gets the PageOrientation.

func (*Page) PageSize

func (p *Page) PageSize() PageSize

Gets the PageSize.

func (*Page) PageWidth

func (p *Page) PageWidth() float32

Gets the page width.

func (*Page) RightMargin

func (p *Page) RightMargin() float32

Gets the RightMargin.

func (*Page) SetBottomMargin

func (p *Page) SetBottomMargin(value float32)

sets the BottomMargin.

func (*Page) SetLeftMargin

func (p *Page) SetLeftMargin(value float32)

sets the LeftMargin.

func (*Page) SetPageHeight

func (p *Page) SetPageHeight(value float32)

sets the page height.

func (*Page) SetPageOrientation

func (p *Page) SetPageOrientation(value Orientation)

sets the PageOrientation.

func (*Page) SetPageSize

func (p *Page) SetPageSize(value PageSize)

sets the PageSize.

func (*Page) SetPageWidth

func (p *Page) SetPageWidth(value float32)

sets the page width.

func (*Page) SetRightMargin

func (p *Page) SetRightMargin(value float32)

sets the RightMargin.

func (*Page) SetTopMargin

func (p *Page) SetTopMargin(value float32)

sets the TopMargin.

func (*Page) TopMargin

func (p *Page) TopMargin() float32

Gets the TopMargin.

type PageSize

type PageSize string
const (
	A3              PageSize = "A3"
	A4              PageSize = "A4"
	A5              PageSize = "A5"
	A6              PageSize = "A6"
	B3              PageSize = "B3"
	B4              PageSize = "B4"
	B5              PageSize = "B5"
	B5JIS           PageSize = "B5JIS"
	DoublePostcard  PageSize = "DoublePostcard"
	Envelope10      PageSize = "Envelope10"
	EnvelopeDL      PageSize = "EnvelopeDL"
	EnvelopeC5      PageSize = "EnvelopeC5"
	EnvelopeB5      PageSize = "EnvelopeB5"
	EnvelopeMonarch PageSize = "EnvelopeMonarch"
	Executive       PageSize = "Executive"
	Legal           PageSize = "Legal"
	Folio           PageSize = "Folio"
	Letter          PageSize = "Letter"
	Postcard        PageSize = "Postcard"
	PRC16K          PageSize = "PRC16K"
	PRC32K          PageSize = "PRC32K"
	Quatro          PageSize = "Quatro"
	Statement       PageSize = "Statement"
	Tabloid         PageSize = "Tabloid"
)

Represents Page Orientation.

type Pdf

type Pdf struct {
	Input

	Elements []element.ElementCollector `json:"elements"` /*TODO:Type*/
	// contains filtered or unexported fields
}

Represents a pdf input.

func NewPdfWithCloudPath

func NewPdfWithCloudPath(cloudResourcePath string, option MergeOptions) *Pdf

Initializes a new instance of the `PdfInput` class.

  • @param { string } The resource path in cloud resource manager.
  • @param {MergeOptions} mergeOptions The merge options for the pdf.

func NewPdfWithResource

func NewPdfWithResource(resource resource.PdfResource) *Pdf

Initializes a new instance of the `PdfInput` class.

  • @param { PdfResource} resource The resource of type `PdfResource`.
  • @param {MergeOptions} mergeOptions The merge options for the pdf.

func NewPdfWithResourceWithMergerOption

func NewPdfWithResourceWithMergerOption(resource resource.PdfResource, option MergeOptions) *Pdf

Initializes a new instance of the `PdfInput` class.

  • @param { PdfResource} resource The resource of type `PdfResource`.
  • @param {MergeOptions} mergeOptions The merge options for the pdf.

func (*Pdf) InputType

func (p *Pdf) InputType() InputType

func (*Pdf) Resources

func (p *Pdf) Resources() []resource.Resource

type TextReplace

type TextReplace struct {
	Input
}

Represents a Word input.

func NewTextReplace

func NewTextReplace(text string, replaceText string, matchCase bool) *TextReplace

* Represents the find and replace values and its options.

func (*TextReplace) MatchCase

func (p *TextReplace) MatchCase() bool

* If True, the search operation will be case sensitive.

func (*TextReplace) ReplaceText

func (p *TextReplace) ReplaceText() string

* Gets or sets ReplaceText value.This string will replace the <see cref="Text"/> during conversion

func (*TextReplace) SetMatchCase

func (p *TextReplace) SetMatchCase(value bool)

func (*TextReplace) SetReplaceText

func (p *TextReplace) SetReplaceText(value string)

*sets ReplaceText value.This string will replace the <see cref="Text"/> during conversion

func (*TextReplace) SetText

func (p *TextReplace) SetText(value string)

* sets the Find Text value. This string will be replaced with <see cref="ReplaceText"/> during conversion.

func (*TextReplace) Text

func (p *TextReplace) Text() string

* Gets the Find Text value. This string will be replaced with <see cref="ReplaceText"/> during conversion.

type Word

type Word struct {
	Converter
}

Represents a Word input.

func NewWordInputWithResource

func NewWordInputWithResource(resources resource.WordResource) *Word

Initializes a new instance of the `WordInput` class.

  • @param { string} input The Word embeded as a string.

func (*Word) InputType

func (p *Word) InputType() InputType

func (*Word) Resources

func (p *Word) Resources() []resource.Resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL