DigiOffice Gateway Web Services

<back to all web services

GenerateWordPrintableDocument

Generate a (corporate identity) printable document based on an existing document registration or working file.

Requires Authentication
The following routes are available for this service:
All Verbs/api/documentgenerator/word/generateprintabledocument
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class DocumentBase64File implements IConvertible
{
    String? ContentType;
    String? Content;

    DocumentBase64File({this.ContentType,this.Content});
    DocumentBase64File.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ContentType = json['ContentType'];
        Content = json['Content'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ContentType': ContentType,
        'Content': Content
    };

    getTypeName() => "DocumentBase64File";
    TypeContext? context = _ctx;
}

class GenerateWordPrintableDocumentResponse implements IGenerateWordPrintableDocumentResponse, IConvertible
{
    /**
    * The file to print
    */
    // @ApiMember(Description="The file to print")
    DocumentBase64File? File;

    GenerateWordPrintableDocumentResponse({this.File});
    GenerateWordPrintableDocumentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        File = JsonConverters.fromJson(json['File'],'DocumentBase64File',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'File': JsonConverters.toJson(File,'DocumentBase64File',context!)
    };

    getTypeName() => "GenerateWordPrintableDocumentResponse";
    TypeContext? context = _ctx;
}

enum PrintLogoStyle
{
    Colour,
    Invisible,
}

class WordPageSetup implements IConvertible
{
    int? FirstPageTray;
    int? OtherPagesTray;

    WordPageSetup({this.FirstPageTray,this.OtherPagesTray});
    WordPageSetup.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FirstPageTray = json['FirstPageTray'];
        OtherPagesTray = json['OtherPagesTray'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FirstPageTray': FirstPageTray,
        'OtherPagesTray': OtherPagesTray
    };

    getTypeName() => "WordPageSetup";
    TypeContext? context = _ctx;
}

/**
* Generate a (corporate identity) printable document based on an existing document registration or working file.
*/
// @Api(Description="Generate a (corporate identity) printable document based on an existing document registration or working file.")
class GenerateWordPrintableDocument implements IGenerateWordPrintableDocument, IRegisteredDocumentRequest, IConvertible
{
    /**
    * ID of the current document registration
    */
    // @ApiMember(Description="ID of the current document registration", IsRequired=true)
    String? RegisteredDocumentID;

    /**
    * The unsaved active document to print instead of the saved document.
    */
    // @ApiMember(Description="The unsaved active document to print instead of the saved document.")
    DocumentBase64File? WorkingFile;

    /**
    * When printing on stationary use PrintLogoStyle.Hidden to remove subsidary logo's from the document
    */
    // @ApiMember(Description="When printing on stationary use PrintLogoStyle.Hidden to remove subsidary logo's from the document")
    PrintLogoStyle? LogoStyle;

    /**
    * Represents a subset of the page setup properties of a section.
    */
    // @ApiMember(Description="Represents a subset of the page setup properties of a section.")
    WordPageSetup? PageSetup;

    GenerateWordPrintableDocument({this.RegisteredDocumentID,this.WorkingFile,this.LogoStyle,this.PageSetup});
    GenerateWordPrintableDocument.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        RegisteredDocumentID = json['RegisteredDocumentID'];
        WorkingFile = JsonConverters.fromJson(json['WorkingFile'],'DocumentBase64File',context!);
        LogoStyle = JsonConverters.fromJson(json['LogoStyle'],'PrintLogoStyle',context!);
        PageSetup = JsonConverters.fromJson(json['PageSetup'],'WordPageSetup',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'RegisteredDocumentID': RegisteredDocumentID,
        'WorkingFile': JsonConverters.toJson(WorkingFile,'DocumentBase64File',context!),
        'LogoStyle': JsonConverters.toJson(LogoStyle,'PrintLogoStyle',context!),
        'PageSetup': JsonConverters.toJson(PageSetup,'WordPageSetup',context!)
    };

    getTypeName() => "GenerateWordPrintableDocument";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'digiofficeapigateway.deltares.nl', types: <String, TypeInfo> {
    'DocumentBase64File': TypeInfo(TypeOf.Class, create:() => DocumentBase64File()),
    'GenerateWordPrintableDocumentResponse': TypeInfo(TypeOf.Class, create:() => GenerateWordPrintableDocumentResponse()),
    'PrintLogoStyle': TypeInfo(TypeOf.Enum, enumValues:PrintLogoStyle.values),
    'WordPageSetup': TypeInfo(TypeOf.Class, create:() => WordPageSetup()),
    'GenerateWordPrintableDocument': TypeInfo(TypeOf.Class, create:() => GenerateWordPrintableDocument()),
});

Dart GenerateWordPrintableDocument DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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: application/json
Content-Type: application/json
Content-Length: length

{"RegisteredDocumentID":"00000000-0000-0000-0000-000000000000","WorkingFile":{"ContentType":"String","Content":"String"},"LogoStyle":"Colour","PageSetup":{"FirstPageTray":0,"OtherPagesTray":0}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"File":{"ContentType":"String","Content":"String"}}