resource

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGifImage

func IsGifImage(header []byte) bool

func IsJpeg2000Image

func IsJpeg2000Image(header []byte) bool

func IsJpegImage

func IsJpegImage(header []byte) bool

func IsPngImage

func IsPngImage(header []byte) bool

func IsTiffImage

func IsTiffImage(header []byte) bool

func IsValidBitmapImage

func IsValidBitmapImage(header []byte) bool

Types

type AdditionalResource added in v2.2.0

type AdditionalResource struct {
	Resource
}

func NewAdditionalResource added in v2.2.0

func NewAdditionalResource(resourcePath string, resourceName string) AdditionalResource

func NewAdditionalResourceWithByteValue added in v2.2.0

func NewAdditionalResourceWithByteValue(resourceData []byte, resourceName string, resourceType ResourceType) AdditionalResource

type AdditionalResourceType added in v2.2.0

type AdditionalResourceType int
const (
	// Image resource.
	Image AdditionalResourceType = 0
	// Pdf resource.
	Pdf AdditionalResourceType = 1
	// Font resource.
	Font AdditionalResourceType = 2
	// Html resource
	Html AdditionalResourceType = 3
)

type DlexResource

type DlexResource struct {
	Resource
	// contains filtered or unexported fields
}

Represents a Dlex resource object that is created using the DLEX file and a name.

func NewDlexResourceWithByteValue

func NewDlexResourceWithByteValue(value []byte, resourceName string) *DlexResource

Initializes a new instance of the `DlexResource` class with DLEX file path and resource name or byte data of the DLEX file and resource name as parameters.

  • @param {byte[]} The byte array of the dlex file.
  • @param {string} resource The name of the resource.

func NewDlexResourceWithPath

func NewDlexResourceWithPath(dlexPath string, resourceName string) *DlexResource

Initializes a new instance of the `DlexResource` class with DLEX file path and resource name or byte data of the DLEX file and resource name as parameters.

  • @param {string} dlex The dlex file path.
  • @param {string} resource The name of the resource.

func (DlexResource) LayoutDataResourceName

func (p DlexResource) LayoutDataResourceName() string

Gets name for layout data resource.

func (DlexResource) ResourceType

func (p DlexResource) ResourceType() ResourceType

func (DlexResource) SetLayoutDataResourceName

func (p DlexResource) SetLayoutDataResourceName(layoutData string)

Sets name for layout data resource.

type ExcelResource added in v2.1.0

type ExcelResource struct {
	Resource
	// contains filtered or unexported fields
}

Represents a excel resource object that is created using the excel file and a name.

func NewExcelResourceWithByteValue added in v2.1.0

func NewExcelResourceWithByteValue(resource []byte, resourceName string) ExcelResource

Initializes a new instance of the `ExcelResource` class.

  • @param {Byte[]} The byte array of the Excel file.
  • @param {string} resourceName The name of the resource.

func NewExcelResourceWithResourcePath added in v2.1.0

func NewExcelResourceWithResourcePath(resource string, resourceName string) ExcelResource

Initializes a new instance of the `excelResource` class with excel file path and resource name.

  • @param {string} excel The excel file path.
  • @param {string} resourceName The name of the resource.

func (ExcelResource) ResourceType added in v2.1.0

func (p ExcelResource) ResourceType() ResourceType

type FontResource

type FontResource struct {
	Resource
}

func NewFontResource

func NewFontResource() *FontResource

func (FontResource) FileExtension

func (p FontResource) FileExtension() string

func (FontResource) ResourceType

func (p FontResource) ResourceType() ResourceType

type HtmlResource

type HtmlResource struct {
	Resource
}

Represents the pdf resource.

func NewHtmlResource

func NewHtmlResource(resource string, resourceName string) HtmlResource

Initializes a new instance of the `HtmlResource` class with html string and resource name. * @param {string} html The Html string. * @param {string} resource The name of the resource.

func (HtmlResource) ResourceType

func (p HtmlResource) ResourceType() ResourceType

type ImageResource

type ImageResource struct {
	Resource
}

Represents an image resource used to create an `ImageResource` object to create PDF from images.

func NewImageResourceWithByteValue

func NewImageResourceWithByteValue(resource []byte, resourceName string) ImageResource

Initializes a new instance of the `ImageResource` class.

  • @param {Byte[]} The byte array of the image file.
  • @param {string} resourceName The name of the resource.

func NewImageResourceWithResourcePath

func NewImageResourceWithResourcePath(resource string, resourceName string) ImageResource

Initializes a new instance of the `ImageResource` class.

  • @param {string} filePath The image file path.
  • @param {string} resourceName The name of the resource.

func (ImageResource) ResourceType

func (p ImageResource) ResourceType() ResourceType

type LayoutDataResource

type LayoutDataResource struct {
	Resource
}

Represents the Layout data resource used to create PDF reports.

func NewLayoutDataResource

func NewLayoutDataResource(filepath string, layoutdataresourcename string) LayoutDataResource

Initializes a new instance of the `LayoutDataResource` class using the layout data object and a resource name.

  • @param {string }The layout data JSON file path.
  • @param {string} layoutDataResourceName The name for layout data resource.

func (LayoutDataResource) ResourceType

func (p LayoutDataResource) ResourceType() ResourceType

type PdfResource

type PdfResource struct {
	Resource
	// contains filtered or unexported fields
}

Represents the pdf resource.

func NewPdfResourceWithByteValue

func NewPdfResourceWithByteValue(value []byte, resourceName string) PdfResource

Initializes a new instance of the `PdfResource` class.

  • @param {Byte[]}The byte array of the pdf file.
  • @param {string} resourceName The name of the resource.

func NewPdfResourceWithResourcePath

func NewPdfResourceWithResourcePath(resource string, resourceName string) PdfResource

Initializes a new instance of the `PdfResource` class.

  • @param {string} input The pdf file path.
  • @param {string} resourceName The name of the resource.

func (PdfResource) ResourceType

func (p PdfResource) ResourceType() ResourceType

type Resource

type Resource struct {
	// Gets or sets the resource name.
	ResourceName           string `json:"resourceName,omitempty"`
	LayoutDataResourceName string `json:"layoutDataResourceName,omitempty"`
	// contains filtered or unexported fields
}

Represents the base class resource.

func NewResourceWithByteValue

func NewResourceWithByteValue(input []byte, resourceName string) *Resource

func NewResourceWithPath

func NewResourceWithPath(input string, resourceName string) Resource

func (*Resource) Data

func (p *Resource) Data() []byte

func (*Resource) MarshalJSON

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

func (*Resource) ResourceType

func (p *Resource) ResourceType() ResourceType

type ResourceType

type ResourceType int
const (
	// Image resource.
	ImageResourceType ResourceType = 0
	// Pdf resource.
	PdfResourceType ResourceType = 1
	// LayoutData resource.
	LayoutDataResourceType ResourceType = 2
	// Dlex resource.
	DlexResourceType ResourceType = 3
	// Font resource.
	FontResourceType ResourceType = 4
	// Html resource
	HtmlResourceType ResourceType = 5
	//Word Resource
	WordResourceType ResourceType = 6
	//Excel Resource
	ExcelResourceType ResourceType = 7
)

type WordResource

type WordResource struct {
	Resource
	// contains filtered or unexported fields
}

Represents a word resource object that is created using the word file and a name.

func NewWordResourceWithByteValue

func NewWordResourceWithByteValue(resource []byte, resourceName string) WordResource

Initializes a new instance of the `WordResource` class.

  • @param {Byte[]} The byte array of the Word file.
  • @param {string} resourceName The name of the resource.

func NewWordResourceWithResourcePath

func NewWordResourceWithResourcePath(resource string, resourceName string) WordResource

Initializes a new instance of the `wordResource` class with word file path and resource name.

  • @param {string} word The word file path.
  • @param {string} resourceName The name of the resource.

func (WordResource) ResourceType

func (p WordResource) ResourceType() ResourceType

Jump to

Keyboard shortcuts

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