endpoint

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Represents the pdf response.

Represents the base class for response.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default ApiKey for all endpoints.
	DefaultApiKey string = ""

	// Default base URL
	DefaultBaseUrl string = "https://api.dynamicpdf.com/"
)

Functions

func SetLogger added in v1.0.2

func SetLogger(logger log.Logger)

Types

type Action

type Action interface {
}

Base class representing an action to perform tasks in many places such as in outlines, links, buttons etc.

type Aes128Security

type Aes128Security struct {
	Security
}
Represents AES 128 bit PDF document security.

AES 128 bit PDF security is compatible with PDF version 1.5 and higher and, Adobe Acrobat Reader version 7 or higher is needed to open these documents. Older readers will not be able to read documents encrypted with this security.

func NewAes128Security

func NewAes128Security(userPwd string, ownerPwd string) *Aes128Security

Initializes a new instance of the `Aes128Security` class by taking the owner and user passwords as parameters to create PDF.

  • @param {string} userPassword The owner password to open the document.
  • @param {string} ownerPassword The user password to open the document.

func (*Aes128Security) DocumentComponents

func (p *Aes128Security) DocumentComponents() EncryptDocumentComponents
Gets the `EncryptDocumentComponents` components of the document to be encrypted.

We can encrypt all the PDF content or the content, excluding the metadata.

func (*Aes128Security) SetDocumentComponents

func (p *Aes128Security) SetDocumentComponents(value EncryptDocumentComponents)
sets the `EncryptDocumentComponents` components of the document to be encrypted.

We can encrypt all the PDF content or the content, excluding the metadata.

type Aes256Security

type Aes256Security struct {
	Security
}
Represents AES 256 bit PDF document security.

AES 128 bit PDF security is compatible with PDF version 1.5 and higher.

func NewAes256Security

func NewAes256Security(userPwd string, ownerPwd string) *Aes256Security

Initializes a new instance of the `Aes256Security` class by taking the owner and user passwords as parameters to create PDF.

  • @param {string} userPassword The owner password to open the document.
  • @param {string} ownerPassword The user password to open the document.

func (*Aes256Security) DocumentComponents

func (p *Aes256Security) DocumentComponents() EncryptDocumentComponents
Gets the `EncryptDocumentComponents`, components of the document to be encrypted.

We can encrypt all the PDF content or the content, excluding the metadata.

func (*Aes256Security) SetDocumentComponents

func (p *Aes256Security) SetDocumentComponents(value EncryptDocumentComponents)
Sets the `EncryptDocumentComponents`, components of the document to be encrypted.

We can encrypt all the PDF content or the content, excluding the metadata.

type ButtonFieldInformation

type ButtonFieldInformation struct {
	// Gets or Sets the name of the button field.
	Name string `json:"name,omitempty"`

	// Gets or sets the type of the button field, ex: RadioButton, CheckBox etc.
	Type int `json:"type,omitempty"`

	// Gets or sets the value of the button field.
	Value string `json:"value,omitempty"`

	/*Gets or Sets the default value of the button field. */
	DefaultValue string `json:"defaultValue,omitempty"`

	/*
		Gets or Sets the export value. These values will be exported when submitting the form.
		 To create a set of mutually exclusive radio buttons
		(i.e., where only one can be selected at a time),
		create the fields with the same name but different export values.
	*/
	ExportValue string `json:"exportValue,omitempty"`

	// Gets the collection of export value.
	ExportValues []string `json:"exportValues,omitempty"`
}

type ButtonFieldType

type ButtonFieldType int

Specifies the type of a button field.

const (
	// Represents a Radio Button.
	RadioButton ButtonFieldType = 1
	// Represents a Checkbox.
	CheckBox ButtonFieldType = 2
)

type ChoiceFieldInformation

type ChoiceFieldInformation struct {
	// Gets or Sets the name of the button field.
	Name string `json:"name,omitempty"`

	// Gets or sets the type of the button field, ex: RadioButton, CheckBox etc.
	Type int `json:"type,omitempty"`

	// Gets or sets the value of the button field.
	Value string `json:"value,omitempty"`

	// Gets or Sets the default value of the button field.
	DefaultValue string `json:"default,omitempty"`

	// Gets or Sets the export value.
	ExportValue string `json:"exportValue,omitempty"`

	// Gets the collection of items.
	Items []string `json:"items,omitempty"`

	ItemExportValues []string `json:"itemExportValues,omitempty"`
}
Represents the information of a choice field in interactive forms.

A choice field contains several text items, one or more of which may be selected as the field value.

type ChoiceFieldType

type ChoiceFieldType int

Specifies type of the Choice Field.

const (
	// Represents a List box.
	ListBox ChoiceFieldType = 1
	// Represents a Combo box.
	ComboBox ChoiceFieldType = 2
)

type Dlex

type Dlex struct {
	Endpoint `json:"-"` // This will bekipped in JSON

	// Gets or sets the DLEX file path present in the resource manager.
	DlexPath string `json:"dlexPath,omitempty"`
	// contains filtered or unexported fields
}

Represents a Dlex layout endpoint.

func NewDlexEndpoint

func NewDlexEndpoint(cloudDlexPath string, resource resource.LayoutDataResource) *Dlex
Initializes a new instance of the <see cref="DlexLayout"/> class using the

DLEX file path present in the cloud environment and the JSON data for the PDF report.

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

func (*Dlex) ApiKey

func (p *Dlex) ApiKey() string

func (*Dlex) BaseUrl

func (p *Dlex) BaseUrl() string

func (*Dlex) EndpointName

func (p *Dlex) EndpointName() string

func (*Dlex) Process

func (p *Dlex) Process() <-chan PdfResponse

Process the DLEX and layout data to create PDF report.

  • @returns A Promise of DlexResponse callback.

type EncryptDocumentComponents

type EncryptDocumentComponents int

Specifies the document components to be encrypted.

const (
	// Encrypts all document contents.
	All EncryptDocumentComponents = iota
	// Encrypts all document contents except metadata.
	AllExceptMetadata EncryptDocumentComponents = iota
)

type Endpoint

type Endpoint struct {
	EndpointProcessor
	BaseUrl, ApiKey string
}

type EndpointProcessor

type EndpointProcessor interface {
	EndpointName() string
	BaseUrl() string
	ApiKey() string
}

Represents the base class for endpoint and has settings for base url, api key and creates a rest request object.

type FormField

type FormField struct {
	// Gets or sets name of the form field.
	Name string `json:"name,omitempty"`
	// Gets or sets value of the form field.
	Value string `json:"value,omitempty"`
	// Gets or sets a boolean indicating whether to flatten the form field.
	Flatten bool `json:"flatten,omitempty"`
	// Gets or sets a boolean indicating whether to remove the form field.
	Remove bool `json:"remove,omitempty"`
}

Represents a form field in the PDF document.

func NewFormField

func NewFormField(name string) *FormField

Initializes a new instance of the `FormField` class

  • using the name of the form field as a parameter.
  • @param {string} name The name of the form field.

func NewFormFieldWithValue

func NewFormFieldWithValue(name string, value string) *FormField

Initializes a new instance of the `FormField` class

  • using the name of the form field as a parameter.
  • @param {string} name The name of the form field.
  • @param {string} value The value of the form field.

type FormFieldInformation

type FormFieldInformation struct {
	resource.Resource
	// Gets or sets a collection of `SignatureFieldInformation`
	SignatureFields []string `json:"signatureFields,omitempty"`
	// Gets or sets a collection of `TextFieldInformation`
	TextFields []string `json:"textFields,omitempty"`
	//  Gets or sets a collection of `ChoiceFieldInformation` .
	ChoiceFields []string `json:"choiceFields,omitempty"`
	// Gets or sets a collection of `ButtonFieldInformation`
	ButtonFields []string `json:"buttonFields,omitempty"`
	// Gets or sets a collection of `PushButtonInformation`
	PushButtons []string `json:"pushButtons,omitempty"`
	// Gets or sets a collection of `MultiSelectListBoxInformation`
	MultiSelectListBoxFields []string `json:"multiSelectListBoxFields,omitempty"`
}

Represents the form field information containing the collection of different types of field information.

type GoToAction

type GoToAction struct {
	Action
	// Gets or sets `PageZoom` to display the destination.
	PageZoom PageZoom `json:"pageZoom,omitempty"`
	// Gets or sets page Offset.
	PageOffset int `json:"pageOffset,omitempty"`
	// contains filtered or unexported fields
}

Represents a goto action in a PDF document that navigates to a specific page using page number and zoom options.

func NewGoToAction

func NewGoToAction(input input.Input, pageOffset int, pageZoom PageZoom) *GoToAction

Initializes a new instance of the `GoToAction` class

  • using an input to create the PDF, page number, and a zoom option.
  • @param {Input} input Any of the `ImageInput`, `DlexInput`, `PdfInput` or `PageInput` objects to create PDF.
  • @param {int} pgOffset Page number to navigate.
  • @param {pageZoom} pgZoom Page Zoom to display the destination.

type ImageInfo

type ImageInfo struct {
	Endpoint
	// contains filtered or unexported fields
}

Represents an image information endpoint.

func NewImageInfo

func NewImageInfo(image resource.ImageResource) *ImageInfo

Initializes a new instance of the `ImageInfo` class.

  • @param {ImageResource} resource The image resource of type `ImageResource`.

func (*ImageInfo) ApiKey

func (p *ImageInfo) ApiKey() string

func (*ImageInfo) BaseUrl

func (p *ImageInfo) BaseUrl() string

func (*ImageInfo) EndpointName

func (p *ImageInfo) EndpointName() string

func (ImageInfo) MarshalJSON

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

func (*ImageInfo) Process

func (p *ImageInfo) Process() <-chan ImageResponse

Process the image resource to get image's information.

  • @returns A Promise of ImageResponse callback.

type ImageInformation

type ImageInformation struct {
	Endpoint
	// Gets page number of the pdf where the image is present.
	PageNumber int `json:"pageNumber,omitempty"`

	// Gets the width of the image.
	Width float32 `json:"width,omitempty"`

	// Gets the height of the image.
	Height float32 `json:"height,omitempty"`

	// Gets the horizontalDpi of the image.
	HorizontalDpi float32 `json:"horizontalDpi,omitempty"`

	// Gets the verticalDpi of the image.
	VerticalDpi float32 `json:"verticalDpi,omitempty"`

	// Gets the number of color components present in the image.
	NumberOfComponents float32 `json:"numberOfComponents,omitempty"`

	// Gets the bits per component of the image.
	BitsPerComponent float32 `json:"bitsPerComponent,omitempty"`

	// Gets the color space of the image.
	ColorSpace int `json:"colorSpace,omitempty"`
}

type ImageResponse

type ImageResponse struct {
	JsonResponse
}

Represents an image response.

func NewImageResponse

func NewImageResponse(jsonContent string) *ImageResponse

Initializes a new instance of the `ImageResponse` class.

  • @param {string} imageResponse The image content of the response.

func (*ImageResponse) Content

func (pr *ImageResponse) Content() *bytes.Buffer

type JsonResponse

type JsonResponse struct {
	Response
	// contains filtered or unexported fields
}

Represents the base class for json response.

func (*JsonResponse) ClientError

func (r *JsonResponse) ClientError() error

func (*JsonResponse) ErrorId

func (r *JsonResponse) ErrorId() uuid.UUID

Gets the error id.

func (*JsonResponse) ErrorJson

func (r *JsonResponse) ErrorJson() string

Gets the error json.

func (*JsonResponse) ErrorMessage

func (r *JsonResponse) ErrorMessage() string

Gets the error message.

func (*JsonResponse) IsSuccessful

func (r *JsonResponse) IsSuccessful() bool

Gets the boolean, indicating the response's status.

func (*JsonResponse) SetStatusMessage

func (r *JsonResponse) SetStatusMessage(statusMessage string)

func (*JsonResponse) StatusCode

func (r *JsonResponse) StatusCode() int

Gets the status code.

type MultiSelectListBoxInformation

type MultiSelectListBoxInformation struct {
	// Gets or Sets the name of a MultiSelectListBox.
	Name string `json:"name,omitempty"`

	// Gets or sets a collection of values of the MultiSelectListBox.
	Values []string `json:"values,omitempty"`

	// Gets or sets a collection of default values of the MultiSelectListBox.
	DefaultValues []string `json:"defaultValues,omitempty"`

	// Gets or sets a collection of export values of the MultiSelectListBox.
	ExportValues []string `json:"exportValues,omitempty"`

	// Gets or sets a collection of items of the MultiSelectListBox.
	Items []string `json:"items,omitempty"`

	// Gets or sets a collection of export values of the MultiSelectListBox.
	ItemsExportValues []string `json:"itemsExportValues,omitempty"`
}

Represents information of a MultiSelectListBox.

type Outline

type Outline struct {
	// Gets or sets the text of the outline.
	Text string `json:"text,omitempty"`

	// Gets or sets a value specifying if the outline is expanded.
	Expanded bool `json:"expanded,omitempty"`

	// Gets or sets the style of the outline.
	Style OutlineStyle `json:"style,omitempty"`
	// contains filtered or unexported fields
}

Represents an outline.

func (*Outline) Action

func (p *Outline) Action() Action

Gets the Action of the outline.

func (*Outline) Children

func (p *Outline) Children() OutlineList

func (*Outline) Color

func (p *Outline) Color() color.Color

Gets the color of the outline.

func (*Outline) GetChildren

func (p *Outline) GetChildren() []Outline

Gets a collection of child outlines.

func (Outline) MarshalJSON

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

func (*Outline) SetColor

func (p *Outline) SetColor(value color.Color)

sets the color of the outline.

type OutlineList

type OutlineList struct {
	// contains filtered or unexported fields
}

Represents an outlineList.

func (*OutlineList) Add

func (p *OutlineList) Add(value string) Outline

Adds an `Outline` object to the outline list.

  • @param {string} text Text of the outline.
  • @returns outline

func (*OutlineList) AddPdfOutlines

func (p *OutlineList) AddPdfOutlines(value input.Pdf)

func (*OutlineList) AddWithInputValue

func (p *OutlineList) AddWithInputValue(text string, input input.Input, pageOffSet int, pageZoom PageZoom) *Outline

Adds an `Outline` object to the outline list.

  • @param {string} text Text of the outline.
  • @param {Input} Any of the `ImageInput`, `DlexInput`, `PdfInput`,
  • @param {*} pgOffset Page number to navigate.
  • @param {*} pgZoom Page Zoom to display the destination.
  • @returns outline

func (*OutlineList) AddWithURL

func (p *OutlineList) AddWithURL(value string, url Action) Outline

Adds an `Outline` object to the outline list.

  • @param {string} text Text of the outline.
  • @param {string} input URL the action launches.
  • @returns outline

func (OutlineList) MarshalJSON

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

type OutlineStyle

type OutlineStyle int
const (

	// Bold.
	Bold OutlineStyle = 0

	// BoldItalic.
	BoldItalic OutlineStyle = 1

	// Italic.
	Italic OutlineStyle = 2

	// Regular.
	Regular OutlineStyle = 3
)

type PageInformation

type PageInformation struct {

	// Gets or sets the page number.
	PageNumber int `json:"pageNumber,omitempty"`

	// Gets or sets the width of the page.
	Width float32 `json:"width,omitempty"`

	// Gets or sets the height of the page.
	Height float32 `json:"height,omitempty"`
}

type PageZoom

type PageZoom int
const (

	// Keep unchanged.
	Retain PageZoom = 0

	// Fit page in window.
	FitPage PageZoom = 1

	// Fit width of page in window.
	FitWidth PageZoom = 2

	// Fit height of page in window.
	FitHeight PageZoom = 3

	// Fit all elements of page in window.
	FitBox PageZoom = 4
)

type Pdf

type Pdf struct {
	Endpoint                  `json:"-"`             // This will be skipped in JSON
	Author                    string                 `json:"author"`
	Title                     string                 `json:"title"`
	Subject                   string                 `json:"subject"`
	Creator                   string                 `json:"creator"`
	Keywords                  string                 `json:"keywords"`
	Producer                  string                 `json:"producer"`
	Templates                 []element.Template     `json:"templates"`  /*TODO: Type*/
	Fonts                     []font.Font            `json:"fonts"`      /*TODO: Type*/
	FormFields                []FormField            `json:"formFields"` /*TODO: Type*/
	Outlines                  OutlineList            `json:"outlines"`   /*TODO: Type*/
	Inputs                    []input.InputCollector `json:"inputs"`
	Security                  Security               `json:"security"`
	FlattenAllFormFields      bool                   `json:"flattenAllFormFields"`
	RetainSignatureFormFields bool                   `json:"retainSignatureFormFields"`
	// contains filtered or unexported fields
}

Represents a pdf endpoint.

func NewPdf

func NewPdf() *Pdf

Initializes a new instance of the `Pdf` class.

func (*Pdf) AddDlexWithCloudResourceNLayoutData

func (p *Pdf) AddDlexWithCloudResourceNLayoutData(cloudResourcePath string, layoutData resource.LayoutDataResource) *input.Dlex

Returns a `DlexInput` object containing the input pdf.

  • @param {String} The resource path in cloud resource manager.
  • @param {LayoutDataResource} value1 The layout data resource of type `LayoutDataResource`
  • @returns DlexInput

func (*Pdf) AddDlexWithCloudResourceNLayoutDataPath

func (p *Pdf) AddDlexWithCloudResourceNLayoutDataPath(cloudResourcePath string, layoutDataPath string) *input.Dlex

Returns a `DlexInput` object containing the input pdf.

  • @param {String} The resource path in cloud resource manager.
  • @param {String} The layout data resource path.
  • @returns DlexInput

func (*Pdf) AddDlexWithDlexResourceNLayoutDataPath

func (p *Pdf) AddDlexWithDlexResourceNLayoutDataPath(resource resource.DlexResource, layoutDataPath string) *input.Dlex

Returns a `DlexInput` object containing the input pdf.

  • @param {DlexResource} value The dlex resource of type `DlexResource`.
  • @param {string} value1 The layout data resource path.
  • @returns DlexInput

func (*Pdf) AddImage

func (p *Pdf) AddImage(resource resource.ImageResource) *input.Image

Returns a `ImageInput` object containing the input pdf.

  • @param {PdfResource} value The resource of type `ImageResource`.
  • @returns ImageInput

func (*Pdf) AddImageCloudPath

func (p *Pdf) AddImageCloudPath(cloudResourcePath string) *input.Image

Returns a `ImageInput` object containing the input pdf.

  • @param {string}The resource path in cloud resource manager.
  • @returns ImageInput

func (*Pdf) AddNewDlexWithDlexNLayoutResources

func (p *Pdf) AddNewDlexWithDlexNLayoutResources(resource resource.DlexResource, layoutData resource.LayoutDataResource) *input.Dlex

Returns a `DlexInput` object containing the input pdf.

  • @param {DlexResource} value The dlex resource of type `DlexResource`.
  • @param {LayoutDataResource} value1 The layout data resource of type `LayoutDataResource`
  • @returns DlexInput

func (*Pdf) AddPage

func (p *Pdf) AddPage() *input.Page

Returns a `PageInput` object containing the input pdf.

  • @returns PageInput

func (*Pdf) AddPageWithDimension

func (p *Pdf) AddPageWithDimension(width float32, height float32) *input.Page

Returns a `PageInput` object containing the input pdf.

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

func (*Pdf) AddPdf

func (p *Pdf) AddPdf(resource resource.PdfResource, option input.MergeOptions) *input.Pdf

Returns a `PdfInput` object containing the input pdf.

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

func (*Pdf) AddPdfCloudPath

func (p *Pdf) AddPdfCloudPath(cloudResourcePath string, option input.MergeOptions) *input.Pdf

Returns a `PdfInput` object containing the input pdf.

  • @param {cloudResourcePath} The resource path in cloud resource manager.
  • @param {MergeOptions} options The merge options for the pdf.
  • @returns PdfInput

func (*Pdf) ApiKey

func (p *Pdf) ApiKey() string

func (*Pdf) BaseUrl

func (p *Pdf) BaseUrl() string

func (*Pdf) EndpointName

func (p *Pdf) EndpointName() string

func (*Pdf) GetInstructionsJson

func (p *Pdf) GetInstructionsJson()

func (*Pdf) Process

func (p *Pdf) Process() <-chan PdfResponse

Process to create pdf.

  • @returns A Promise of PdfResponse callback.

type PdfContent

type PdfContent struct {

	// Gets or sets the page number.
	PageNumber int `json:"pageNumber,omitempty"`

	// Gets or sets the text in the pdf.
	Text string `json:"text,omitempty"`
}

type PdfInfo

type PdfInfo struct {
	Endpoint
	resource.Resource
	// contains filtered or unexported fields
}

Represents the pdf info endpoint.

func NewPdfInfoResource

func NewPdfInfoResource(resource resource.PdfResource) *PdfInfo

Initializes a new instance of the `PdfInfo` class.

  • @param {Resource} resource The resource of type `PdfResource`

func (*PdfInfo) ApiKey

func (p *PdfInfo) ApiKey() string

func (*PdfInfo) BaseUrl

func (p *PdfInfo) BaseUrl() string

func (*PdfInfo) EndpointName

func (p *PdfInfo) EndpointName() string

func (PdfInfo) MarshalJSON

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

func (*PdfInfo) Process

func (p *PdfInfo) Process() <-chan PdfInfoResponse

Process the pdf resource to get pdf's information.

  • @returns A Promise of PdfInfo response

type PdfInfoResponse

type PdfInfoResponse struct {
	JsonResponse
}

Represents the pdf information response.

func NewPdfInfoResponse

func NewPdfInfoResponse() *PdfInfoResponse

Initializes a new instance of the `PdfInfoResponse` class.

func (*PdfInfoResponse) Content

func (pr *PdfInfoResponse) Content() *bytes.Buffer

Gets the pdf information content.

type PdfInformation

type PdfInformation struct {

	// Gets the author.
	Author string `json:"author,omitempty"`

	// Gets the subject.
	Subject string `json:"subject,omitempty"`

	// Gets the keywords.
	Keywords string `json:"keyword,omitempty"`

	// Gets the creator.
	Creator string `json:"creator,omitempty"`

	// Gets the producer.
	Producer string `json:"producer,omitempty"`

	// Gets the title.
	Title string `json:"title,omitempty"`

	// Gets the collection of PageInformation.
	Pages []PageInformation `json:"pages,omitempty"`

	// Gets the form fields.
	FormFields FormFieldInformation `json:"formFields,omitempty"`

	// Gets the custom properties.
	CustomProperties string `json:"customProperties,omitempty"`

	// Gets the boolean representing xmp meta data.
	XmpMetaData bool `json:"xmpMetaData,omitempty"`

	// Gets the boolean, indicating whether the pdf is signed.
	Signed bool `json:"signed,omitempty"`

	// Gets the boolean, indicating whether the pdf is tagged.
	Tagged bool `json:"tagged,omitempty"`
}

Represents the pdf information.

type PdfInstruction

type PdfInstruction struct {
	// contains filtered or unexported fields
}

Represents the pdf information.

func NewPdfInstruction

func NewPdfInstruction() *PdfInstruction

func (*PdfInstruction) GetOutlines

func (p *PdfInstruction) GetOutlines() []Outline

func (*PdfInstruction) MarshalJSON

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

type PdfResponse

type PdfResponse struct {
	// contains filtered or unexported fields
}

Initializes a new instance of the `PdfResponse` class.

  • @param {Buffer[]} pdfContent The byte array of pdf content.

func (*PdfResponse) ClientError

func (r *PdfResponse) ClientError() error

Gets the error json.

func (*PdfResponse) Content

func (pr *PdfResponse) Content() *bytes.Buffer

Gets the content of pdf.

func (*PdfResponse) ErrorId

func (r *PdfResponse) ErrorId() uuid.UUID

Gets the error id.

func (*PdfResponse) ErrorJson

func (r *PdfResponse) ErrorJson() string

Gets the error json.

func (*PdfResponse) ErrorMessage

func (r *PdfResponse) ErrorMessage() string

Gets the error message.

func (*PdfResponse) IsSuccessful

func (r *PdfResponse) IsSuccessful() bool

Gets the boolean, indicating the response's status.

func (*PdfResponse) StatusCode

func (r *PdfResponse) StatusCode() int

Gets the status code.

type PdfText

type PdfText struct {
	Endpoint
	// contains filtered or unexported fields
}

Represents the pdf text endpoint.

func NewPdfText

func NewPdfText(resource resource.PdfResource, startpage int, pagecount int) *PdfText

Initializes a new instance of the `PdfText` class.

  • @param { PdfResource } resource The image resource of type `PdfResource`.`
  • @param { int } startPage The start page.
  • @param { int } pageCount The page count.

func (*PdfText) ApiKey

func (p *PdfText) ApiKey() string

func (*PdfText) BaseUrl

func (p *PdfText) BaseUrl() string

func (*PdfText) EndpointName

func (p *PdfText) EndpointName() string

func (*PdfText) GetPageCount

func (p *PdfText) GetPageCount(pageCount int)

Sets the page count.

func (*PdfText) GetStartPage

func (p *PdfText) GetStartPage(startPage int)

Sets the start page.

func (PdfText) MarshalJSON

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

func (*PdfText) PageCount

func (p *PdfText) PageCount() int

Gets the page count.

func (*PdfText) Process

func (p *PdfText) Process() <-chan PdfTextResponse

Process the pdf resource to get pdf's text.

  • @returns A Promise of PdfTextResponse callback.

func (*PdfText) StartPage

func (p *PdfText) StartPage() int

Gets the start page.

type PdfTextResponse

type PdfTextResponse struct {
	JsonResponse
}

Represnts the pdf resource.

func NewPdfTextResponse

func NewPdfTextResponse() *PdfTextResponse

Initializes a new instance of the `PdfResponse` class.

func (*PdfTextResponse) ClientError

func (r *PdfTextResponse) ClientError() error

func (*PdfTextResponse) Content

func (pr *PdfTextResponse) Content() *bytes.Buffer

Gets the collection of PdfContent.

func (*PdfTextResponse) ErrorId

func (r *PdfTextResponse) ErrorId() uuid.UUID

Gets the error id.

func (*PdfTextResponse) ErrorJson

func (r *PdfTextResponse) ErrorJson() string

Gets the error json.

func (*PdfTextResponse) ErrorMessage

func (r *PdfTextResponse) ErrorMessage() string

Gets the error message.

func (*PdfTextResponse) IsSuccessful

func (r *PdfTextResponse) IsSuccessful() bool

Gets the boolean, indicating the response's status.

func (*PdfTextResponse) StatusCode

func (r *PdfTextResponse) StatusCode() int

Gets the status code.

type PdfXmp

type PdfXmp struct {
	Endpoint
	// contains filtered or unexported fields
}

Represents the pdfresource.

func NewPdfXmp

func NewPdfXmp(resource resource.PdfResource) *PdfXmp

Initializes a new instance of the `PdfXmp` class.

  • @param {PdfResource} resource The image resource of type `PdfResource`.

func (*PdfXmp) ApiKey

func (p *PdfXmp) ApiKey() string

func (*PdfXmp) BaseUrl

func (p *PdfXmp) BaseUrl() string

func (*PdfXmp) EndpointName

func (p *PdfXmp) EndpointName() string

func (PdfXmp) MarshalJSON

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

func (*PdfXmp) Process

func (p *PdfXmp) Process() <-chan PdfXmpResponse

Process the pdf resource to get pdf's xmp data.

  • @returns A Promise of PdfTextResponse callback.

type PdfXmpResponse

type PdfXmpResponse struct {
	JsonResponse
}

Represnts the pdf resource.

func NewPdfXmpResponse

func NewPdfXmpResponse() *PdfXmpResponse

Initializes a new instance of the `XmlResponse` class.

  • @param {string} xmlContent The xml content of the response.

func (*PdfXmpResponse) ClientError

func (r *PdfXmpResponse) ClientError() error

func (*PdfXmpResponse) Content

func (pr *PdfXmpResponse) Content() *bytes.Buffer

Gets the xml content.

func (*PdfXmpResponse) ErrorId

func (r *PdfXmpResponse) ErrorId() uuid.UUID

Gets the error id.

func (*PdfXmpResponse) ErrorJson

func (r *PdfXmpResponse) ErrorJson() string

Gets the error json.

func (*PdfXmpResponse) ErrorMessage

func (r *PdfXmpResponse) ErrorMessage() string

Gets the error message.

func (*PdfXmpResponse) IsSuccessful

func (r *PdfXmpResponse) IsSuccessful() bool

Gets the boolean, indicating the response's status.

func (*PdfXmpResponse) StatusCode

func (r *PdfXmpResponse) StatusCode() int

Gets the status code.

type PushButtonInformation

type PushButtonInformation struct {

	// Gets or Sets the name of a PushButton field.
	Name string `json:"name,omitempty"`

	// Gets or Sets the label of a PushButton field.
	Label string `json:"label,omitempty"`
}

Represents information of a PushButton field.

type RC4128Security

type RC4128Security struct {
	Security
}
Represents RC4 128 bit PDF document security.

RC4 128 bit PDF security, with UseCryptFilter property set to false is compatible with PDF version 1.4 or higher and can be read with Adobe Acrobat Reader version 5 or higher. By default UseCryptFilter property is false. RC4 128 bit PDF security with crypt filter is compatible with PDF version 1.5 or higher and can be read with Adobe Acrobat Reader version 6 and higher. Older readers will not be able to read document encrypted with this security.

func NewRC4128Security

func NewRC4128Security() *RC4128Security

Initializes a new instance of the `RC4128Security` class.

func (*RC4128Security) EncryptMetadata

func (p *RC4128Security) EncryptMetadata() bool

Gets the documents components to be encrypted.

func (*RC4128Security) SetEncryptMetadata

func (p *RC4128Security) SetEncryptMetadata(value bool)

Sets the documents components to be encrypted.

type Response

type Response interface {
	ClientError() error
	IsSuccessful() bool
	ErrorMessage() string
	ErrorId() uuid.UUID
	StatusCode() int
	ErrorJson() string
}

type Securiter

type Securiter interface {
	// contains filtered or unexported methods
}

type Security

type Security struct {
	Securiter `json:"-"`

	//Gets or sets the user password.
	UserPassword string `json:"userPassword,omitempty"`

	//Gets or sets the owner password.
	OwnerPassword string `json:"ownerPassword,omitempty"`

	// Gets or sets if text and images can be copied to the clipboard by the user.
	AllowCopy string `json:"allowCopy,omitempty"`

	// Gets or sets if the document can be edited by the user.
	AllowEdit string `json:"allowEdit,omitempty"`

	// Gets or sets if the document can be printed by the user.
	AllowPrint string `json:"allowPrint,omitempty"`

	//  Gets or sets if annotations and form fields can be added, edited and modified by the user.
	AllowUpdateAnnotationsAndFields string `json:"allowUpdateAnnotationsAndFields,omitempty"`

	// Gets or sets if accessibility programs should be able to read the documents text and images for the user.
	AllowAccessibility string `json:"allowAccessibility,omitempty"`

	// Gets or sets if form filling should be allowed by the user.
	AllowFormFilling string `json:"allowFormFilling,omitempty"`

	// Gets or sets if the document can be printed at a high resolution by the user.
	AllowHighResolutionPrinting string `json:"allowHighResolutionPrinting,omitempty"`

	// Gets or sets if the document can be assembled and manipulated by the user.
	AllowDocumentAssembly string `json:"allowDocumentAssembly,omitempty"`
	// contains filtered or unexported fields
}
Represents AES 128 bit PDF document security.

AES 128 bit PDF security is compatible with PDF version 1.5 and higher and, Adobe Acrobat Reader version 7 or higher is needed to open these documents. Older readers will not be able to read documents encrypted with this security.

func (Security) MarshalJSON

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

type SecurityType

type SecurityType int
const (

	// AES 128 bit security.
	Aes128 SecurityType = 0

	// AES 256 bit security.
	Aes256 SecurityType = 1

	// RC4 128 bit security.
	RC4128 SecurityType = 2
)

Represents information of a PushButton field.

type SignatureFieldInformation

type SignatureFieldInformation struct {
	// Gets or Sets the name of a signature field.
	Name string `json:"name,omitempty"`

	// Gets or Sets the boolean, indicating the field signed or not.
	Signed bool `json:"signed,omitempty"`
}

Represents information of a signature field.

type TextFieldInformation

type TextFieldInformation struct {

	// Gets or Sets the name of the Text field.
	Name string `json:"name,omitempty"`

	// Gets or Sets the value of the Text field.
	Value string `json:"value,omitempty"`

	// Gets or Sets the default value of the Text field.
	DefaultValue string `json:"defaultValue,omitempty"`
}

Represents information of a text field.

type UrlAction

type UrlAction struct {

	// Gets or Sets the name of a signature field.
	Name string `json:"name,omitempty"`

	// Gets or Sets the boolean, indicating the field signed or not.
	Signed bool `json:"signed,omitempty"`
}

Represents information of a signature field.

type XmlResponse

type XmlResponse struct {
	JsonResponse

	// Gets the xml content.
	Content []string `json:"content,omitempty"`
}

Represents the xml response.

Jump to

Keyboard shortcuts

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