All Verbs | /api/documentgenerator/word/generateprintabledocument |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentBase64File:
content_type: Optional[str] = None
content: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GenerateWordPrintableDocumentResponse(IGenerateWordPrintableDocumentResponse):
# @ApiMember(Description="The file to print")
file: Optional[DocumentBase64File] = None
"""
The file to print
"""
class PrintLogoStyle(str, Enum):
COLOUR = 'Colour'
INVISIBLE = 'Invisible'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WordPageSetup:
first_page_tray: Optional[int] = None
other_pages_tray: Optional[int] = None
# @Api(Description="Generate a (corporate identity) printable document based on an existing document registration or working file.")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GenerateWordPrintableDocument(IGenerateWordPrintableDocument, IRegisteredDocumentRequest):
"""
Generate a (corporate identity) printable document based on an existing document registration or working file.
"""
# @ApiMember(Description="ID of the current document registration", IsRequired=true)
registered_document_i_d: Optional[str] = None
"""
ID of the current document registration
"""
# @ApiMember(Description="The unsaved active document to print instead of the saved document.")
working_file: Optional[DocumentBase64File] = None
"""
The unsaved active document to print instead of the saved document.
"""
# @ApiMember(Description="When printing on stationary use PrintLogoStyle.Hidden to remove subsidary logo's from the document")
logo_style: Optional[PrintLogoStyle] = None
"""
When printing on stationary use PrintLogoStyle.Hidden to remove subsidary logo's from the document
"""
# @ApiMember(Description="Represents a subset of the page setup properties of a section.")
page_setup: Optional[WordPageSetup] = None
"""
Represents a subset of the page setup properties of a section.
"""
Python GenerateWordPrintableDocument DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/documentgenerator/word/generateprintabledocument HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
WorkingFile:
{
ContentType: String,
Content: String
},
LogoStyle: Colour,
PageSetup:
{
FirstPageTray: 0,
OtherPagesTray: 0
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { File: { ContentType: String, Content: String } }