As many companies, Mercedes Benz produdes every year it's annual report. In this example we will show how to generate a document in the same style.

1 Buses section

The annual report consists on serveral sections. Let's try to reproduce the buses section.

The example below shows the the original versus the generated one.

Original Generated

2 The source code

The following script code shows how to generate the document.

Copy
// ====================================================================
// Return a file or URL
// ====================================================================
function getFile(name)
{
	if (FILE_PATH.startsWith("http")) {
		return FILE_PATH + name; }
	else
		return new Ax.io.File(FILE_PATH, name).getObject()
}

// ====================================================================
// Constants
// ====================================================================

const FILE_PATH         = "https://bitbucket.org/deister/axional-docs-resources/raw/master/FOP/MercedesBenz/";
const PAGE_FIRST        = "FirstPage";
const PAGE_EVEN         = "EvenPage";
const PAGE_ODD          = "OddPage";
const PAGE_DOUBLE_SIDED = "DoublePageMaster";

const COLOR_GREY_TABLE  = "#E6E7E8";
const COLOR_BLUE_TABLE = "#08677F";

// ====================================================================
// Define the document using 3 page master pages
// ====================================================================
var root = new Ax.fop.DocumentBuilder()
	.setDebug("")
    .addSimplePageMaster(PAGE_FIRST,  0.5, 0.5, 0.5, 1.0)
	.addSimplePageMaster(PAGE_EVEN,  0.5, 0.5, 0.5, 1.0)
	.addSimplePageMaster(PAGE_ODD,   0.5, 0.5, 0.5, 1.0)
.build();

// ====================================================================
// Add document margins
// ====================================================================
root.getSimplePageMaster(PAGE_FIRST).setMargins(1.5, 1.5, 0.5, 1.0);
root.getSimplePageMaster(PAGE_EVEN).setMargins(1.5, 1.5, 0.5, 1.0);
root.getSimplePageMaster(PAGE_ODD).setMargins(1.5, 1.5, 0.5, 1.0);

// ====================================================================
// Define the page sequence, even, odd
// ====================================================================
root.addPageSequenceMaster(PAGE_DOUBLE_SIDED)
    .addSimplePageMaster(PAGE_FIRST, "first")
	.addSimplePageMaster(PAGE_EVEN, "even")
	.addSimplePageMaster(PAGE_ODD, "odd");
	
// ====================================================================
// Add a page sequence. This will generate a FLOW for given name
// ====================================================================

root.addPageSequence(PAGE_DOUBLE_SIDED);

var totalPageNumbeId = root.getPageSequence(PAGE_DOUBLE_SIDED).getTotalPageNumberCitation();

// ====================================================================
// SETUP REGIONS (BODY, HEADER, FOOTER, LEFT, RIGHT)
//
// BODY 2 columns
// ====================================================================

root.getPageMaster(PAGE_FIRST).getRegionBody().setColumnCount(2).setColumnGap(0.5);
root.getPageMaster(PAGE_FIRST).getRegionBefore().setExtent(1.35);

root.getPageMaster(PAGE_EVEN).getRegionBody().setColumnCount(2).setColumnGap(0.5);
root.getPageMaster(PAGE_EVEN).getRegionBefore().setExtent(1.35);

root.getPageMaster(PAGE_ODD).getRegionBody().setColumnCount(2).setColumnGap(0.5);
root.getPageMaster(PAGE_ODD).getRegionBefore().setExtent(1.35);
root.getPageMaster(PAGE_ODD).getRegionAfter().setExtent(1);

// ====================================================================
// FIRST PAGE Header static content
// ====================================================================

var title_bold = "C | THE DIVISIONS |";
var title_normal = "DAIMLER BUSES";

var header_first = root.getStaticContentBefore(PAGE_FIRST).getWrapper()
				.addBlockContainer()
				.setHeight(0.35, "cm")
				.setDisplayAlign("after")
				.addBlock().setTextAlignLast("justify").setFontSize(8).setFontFamily("Candara");
header_first.setTextAlignLast("justify").build(c => {
	c.addInline()
		.addText("180- 182")
	c.addLeader().setLeaderPattern("dots");
	c.addInline()
		.addText(title_bold).setFontWeight("bold");
	c.addInline()
		.addText(title_normal);
});

// ====================================================================
// EVEN PAGE Header static content
// ====================================================================

var header_even = root.getStaticContentBefore(PAGE_EVEN).getWrapper()
				.addBlockContainer()
				.setHeight(0.35, "cm")
				.setDisplayAlign("after")
				.addBlock().setTextAlignLast("justify").setFontSize(8).setFontFamily("Candara");
header_even.setTextAlignLast("justify").build(c => {
	c.addInline()
		.addText(title_bold).setFontWeight("bold");
	c.addInline()
		.addText(title_normal);
	c.addLeader().setLeaderPattern("dots");
	c.addInline()
		.addText("181 - 182")
});

// ====================================================================
// ODD PAGE Header static content
// ====================================================================

var header_odd = root.getStaticContentBefore(PAGE_ODD).getWrapper()
				.addBlockContainer()
				.setHeight(0.35, "cm")
				.setDisplayAlign("after")
				.addBlock().setTextAlignLast("justify").setFontSize(8).setFontFamily("Candara");
header_odd.setTextAlignLast("justify").build(c => {
	c.addInline()
		.addText("182- 182")
	c.addLeader().setLeaderPattern("dots");
	c.addInline()
		.addText(title_bold).setFontWeight("bold");
	c.addInline()
		.addText(title_normal);
});

// ====================================================================
// Get main flow wrapper and set a default font for all document
// ====================================================================
var wrapper = root
	.getBodyFlow(PAGE_DOUBLE_SIDED)
	.getWrapper()
	.setFontFamily("Candara")
;

// ====================================================================
// Create standard block paragraph formats
// ====================================================================
var p_title     = root.createBlockProperties().setSpaceAfter(5).setFontSize(24 ).setSpan("all");
var p_intro     = root.createBlockProperties().setSpaceAfter(90).setFontSize(11.5 ).setSpan("all");
var p_blank		= root.createBlockProperties().setSpan("all");
var p_para      = root.createBlockProperties().setSpaceBefore( 4).setFontSize(8.9); 
var p_headers = root.createBlockProperties().setSpaceBefore(10).setFontSize(10 ).setFontWeight("bold"); 
var p_footer = root.createBlockProperties().setSpaceBefore( 4).setFontSize(8 ).setFontWeight("bold"); 

// ====================================================================
// 
// START WRITING DOCUMENT CONTENT USING PAGE_DOUBLE_SIDED sequence
//
// FIRST, EVEN, ODD
// 
// ====================================================================


// ====================================================================
// INTRO
// ====================================================================

wrapper.addBlock(p_title, "Daimler Buses")
	.setPaddingAfter(5)
	.setPaddingBefore(5)
	.setSpan("all")
	.setTextAlign("left");

wrapper.addBlock(p_intro, "In 2018, business developments at Daimler Buses were strongly influenced by the economic crises in normally profitable key markets and the associated decrease in demand for buses. This situation led to a downward adjustment of anticipated earnings during the year under review, with the division’s full-year EBIT decreasing significantly compared with the previous year. At the same time, the gradual recovery of the Brazilian economy, strong demand in the EU30 region and growth in India led to a significant increase in global unit sales at Daimler Buses in 2018. As the market leader in its most important traditional core markets, Daimler Buses focuses on innovative and pioneering city buses and touring coaches. In 2018, Daimler Buses once again presented itself as a future-oriented manufacturer with new products such as the eCitaro, digital services, a “future package” for our production network and the implementation of the CASE strategy.")
	.setPaddingAfter(5)
	.setPaddingBefore(5)
	.setSpan("all")
	.setTextAlign("left");

wrapper.addBlock(p_intro)
	.setPaddingAfter(5)
	.setPaddingBefore(5)
	.setSpan("all")
	.setTextAlign("left");
// ====================================================================
// Tables C.07 C.08
// ====================================================================

var t_c07 = wrapper
	.addBlock()
		.setPadding(10)
		.setStartIndent(10)
		.setEndIndent(10)
		.setBackgroundColor(COLOR_GREY_TABLE)
		.setSpaceAfter(20)
	.addTable()
		.setFontSize(6.8)
		.setStartIndent(10)
		.setEndIndent(10);

t_c07.addColumn().setColumnWidth(3.5);
t_c07.addColumn();
t_c07.addColumn();
t_c07.addColumn().setColumnWidth(2);

t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(1).addCell().setColspan(4).addBlock('C.07').setStartIndent(0).setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setFontSize(8);
t_c07.getBody().addRow().addCell().setColspan(4).addBlock('Daimler Buses').setStartIndent(0).setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setFontSize(8);
t_c07.getBody().addRow().addCell().setBlockProgressionDimension("0.5cm");

var r_c07_1 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_2 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_3 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_4 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_5 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_6 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_7 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_8 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_9 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_10 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c07_11 = t_c07.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);

																				            r_c07_1.addCell('2018').setColspan(2).setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);	    r_c07_1.addCell('2017').setTextAlign("right").setPadding(1);	            	r_c07_1.addCell('8/19').setTextAlign("right").setPadding(1);
r_c07_2.addCell('€ amounts in millions').setPadding(1);																											                                                                                                                                        	r_c07_2.addCell('% change').setColspan(3).setTextAlign("right").setPadding(1);
r_c07_3.addCell().setColspan(4).setBlockProgressionDimension("0.3cm").setPadding(1);
r_c07_4.addCell('Revenue').setPadding(1);													r_c07_4.addCell('4,529').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);				    r_c07_4.addCell('4.524').setTextAlign("right").setPadding(1);	            	r_c07_4.addCell('+0').setTextAlign("right").setPadding(1);
r_c07_5.addCell('EBIT').setPadding(1);														r_c07_5.addCell('265').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);					r_c07_5.addCell('281').setTextAlign("right").setPadding(1);		            	r_c07_5.addCell('-6').setTextAlign("right").setPadding(1);
r_c07_6.addCell('Return on sales (in %)').setPadding(1);									r_c07_6.addCell('5.9').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);					r_c07_6.addCell('6.2').setTextAlign("right").setPadding(1);                 	r_c07_6.addCell('').setTextAlign("right").setPadding(1);
r_c07_7.addCell('Investment in property, plant and equipment').setPadding(1);				r_c07_7.addCell('144').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1).setPaddingTop(9);	r_c07_7.addCell('94').setTextAlign("right").setPadding(1).setPaddingTop(9); 	r_c07_7.addCell('+53').setTextAlign("right").setPadding(1).setPaddingTop(9);
r_c07_8.addCell('Research and development expenditure thereof capitalized').setPadding(1);	r_c07_8.addCell('199').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1).setPaddingTop(16);	r_c07_8.addCell('194').setTextAlign("right").setPadding(1).setPaddingTop(16);	r_c07_8.addCell('+3').setTextAlign("right").setPadding(1).setPaddingTop(16);
r_c07_9.addCell('Production').setPadding(1);												r_c07_9.addCell('31,233').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);				    r_c07_9.addCell('28,518').setTextAlign("right").setPadding(1);	            	r_c07_9.addCell('+10').setTextAlign("right").setPadding(1);
r_c07_10.addCell('Unit Sales').setPadding(1);												r_c07_10.addCell('30,888').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);				r_c07_10.addCell('28,676').setTextAlign("right").setPadding(1);	            	r_c07_10.addCell('+8').setTextAlign("right").setPadding(1);
r_c07_11.addCell('Employees (December 31)').setPadding(1);									r_c07_11.addCell('18,770').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);				r_c07_11.addCell('18,292').setTextAlign("right").setPadding(1);	            	r_c07_11.addCell('+3').setTextAlign("right").setPadding(1);

t_c07.getBody().addRow().addCell('1. The amounts have been adjusted due to first-time adoption of IFRS 15 and IFRS 9.').setColspan(4);

var t_c08 = wrapper
	.addBlock()
		.setPadding(10)
		.setStartIndent(10)
		.setEndIndent(10)
		.setBackgroundColor(COLOR_GREY_TABLE)
	.addTable()
		.setFontSize(6.8)
		.setStartIndent(10)
		.setEndIndent(10);

t_c08.addColumn().setColumnWidth(3.5);
t_c08.addColumn();
t_c08.addColumn();
t_c08.addColumn().setColumnWidth(2);

t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(1).addCell().setColspan(4).addBlock('C.08').setStartIndent(0).setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setFontSize(8);
t_c08.getBody().addRow().addCell().setColspan(4).addBlock('Unit sales Daimler Buses').setStartIndent(0).setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setFontSize(8);
t_c08.getBody().addRow().addCell().setBlockProgressionDimension("0.5cm");

var r_c08_1 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_2 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_3 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_4 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_5 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_6 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_7 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_8 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_9 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_10 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);
var r_c08_11 = t_c08.getBody().addRow().setBorderBottomStyle("solid").setBorderBottomWidth(0.3);

																	r_c08_1.addCell('2018').setColspan(2).setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);			r_c08_1.addCell('2017').setTextAlign("right").setPadding(1);					r_c08_1.addCell('8/19').setTextAlign("right").setPadding(1);
																																																																						r_c08_2.addCell('% change').setColspan(4).setTextAlign("right").setPadding(1);
r_c08_3.addCell().setColspan(4).setBlockProgressionDimension("0.3cm").setPadding(1);
r_c08_4.addCell('Total').setPadding(1);								r_c08_4.addCell('30,888').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);						r_c08_4.addCell('28,676').setTextAlign("right").setPadding(1);					r_c08_4.addCell('+8').setTextAlign("right").setPadding(1);
r_c08_5.addCell('EU30').setPadding(1);								r_c08_5.addCell('9,284').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);						r_c08_5.addCell('8,687').setTextAlign("right").setPadding(1);					r_c08_5.addCell('+7').setTextAlign("right").setPadding(1);
r_c08_6.addCell('Threof Germany').setPadding(1);					r_c08_6.addCell('2,902').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);						r_c08_6.addCell('3,057').setTextAlign("right").setPadding(1);					r_c08_6.addCell('-5').setTextAlign("right").setPadding(1);
r_c08_7.addCell('Latin America excluding Mexico').setPadding(1);	r_c08_7.addCell('13,681').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1).setPaddingTop(9);	r_c08_7.addCell('12,740').setTextAlign("right").setPadding(1).setPaddingTop(9);	r_c08_7.addCell('+7').setTextAlign("right").setPadding(1).setPaddingTop(9);
r_c08_8.addCell('Threof Brasil').setPadding(1);						r_c08_8.addCell('8,778').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);						r_c08_8.addCell('7,201').setTextAlign("right").setPadding(1);					r_c08_8.addCell('+22').setTextAlign("right").setPadding(1);
r_c08_9.addCell('Mexico').setPadding(1);							r_c08_9.addCell('3,236').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);						r_c08_9.addCell('3,440').setTextAlign("right").setPadding(1);					r_c08_9.addCell('-6').setTextAlign("right").setPadding(1);
r_c08_10.addCell('Asia').setPadding(1);								r_c08_10.addCell('3,172').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);						r_c08_10.addCell('2,348').setTextAlign("right").setPadding(1);					r_c08_10.addCell('+35').setTextAlign("right").setPadding(1);
r_c08_11.addCell('Other markerts').setPadding(1);					r_c08_11.addCell('1,515').setTextAlign("right").setColor(COLOR_BLUE_TABLE).setFontWeight("bold").setPadding(1);						r_c08_11.addCell('1,461').setTextAlign("right").setPadding(1);					r_c08_11.addCell('+4').setTextAlign("right").setPadding(1);


// ====================================================================
// Text 1st Page
// ====================================================================

wrapper.addBlock(p_headers, "Sales significantly above the prior-year level");
wrapper.addBlock(p_para, "Daimler Buses sold 30,900 buses and bus chassis worldwide in financial year 2018 (2017: 28,700). The significant increase was due in particular to the gradual recovery of the economy in Brazil, high demand in our important EU30 market and growth in India. At the same time, the market-related decrease in demand in the normally profitable markets of Argentina and Turkey had a negative impact on our overall sales. The division was able to maintain its market leadership in its most important traditional core markets (EU30, Brazil, Argentina and Mexico). At €4.5 billion, revenue was at the prior-year level (€4.5 billion), while EBIT decreased slightly to €265 million (2017: €281 million).");

wrapper.addBlock(p_headers, "Varied business developments in the core regions");
wrapper.addBlock(p_para, "In the EU30 region, the Daimler Buses brands Mercedes-Benz and Setra offer a complete range of city buses, intercity buses and touring coaches, as well as bus chassis. Due to continued high demand for our complete buses, sales in this region amounted to 9,300 units, which was significantly above the high number recorded in the prior year (2017: 8,700). Daimler Buses maintained its leading market position in the EU30 region with a market share of 29.0% (2017: 28.4%). At 2,900 units, sales in Germany were 5% lower than in the previous year. Sales of 300 units in Turkey were significantly lower than in the prior year (2017: 400) due to the country’s situation, which remains difficult. The market situation in Latin America (excluding Mexico) improved on account of the gradually recovering market in Brazil, although growth in the region was negatively affected by the sharp market contraction in Argentina. Sales of Mercedes- Benz bus chassis in Brazil rose by 22% to 8,800 units. We were able to maintain our leading market position in Brazil with a market share of 51.6% (2017: 52.5%). In India, we continued along our growth path and increased our sales volume to 1,600 units (2017: 900). At 3,200 units, sales in Mexico were significantly lower than in the previous year (2017: 3,400).");

// ====================================================================
// 1st image
// ====================================================================

wrapper.addBlock(p_para)
	.setSpan("all")
	.setTextAlign("center")
	.addExternalGraphic(getFile("image--726.jpg"))
		.setContentWidth(21)
		.setScaling("uniform")
		.setPaddingBefore(5)
		.setPaddingAfter(0);

// ====================================================================
// 1st footer
// ====================================================================

wrapper.addBlock(p_footer, "E-mobility in series maturity: The Mercedes-Benz eCitaro is not only a city bus, it is part of a complete e-mobility system from Daimler Buses.")
	.setPaddingAfter(20)
	.setPaddingBefore(0)
	.setSpan("all")
	.setTextAlign("left");
    
// ====================================================================
// Text 2nd Page
// ====================================================================

wrapper.addBlock(p_headers, "New all-electric Mercedes-Benz eCitaro is an important component of locally emission-free transport in cities");
wrapper.addBlock(p_para, "With the new all-electric Mercedes-Benz eCitaro, which had its world premiere at the IAA Commercial Vehicles trade fair, we now have in our portfolio a key component of environmentally friendly local public transport with low-emission and locally emission-free buses. The bus gets its energy from lithium-ion batteries, and the charging technology it uses allows it to adjust to the individual requirements of transport companies. An innovative thermal management system ensures the efficient use of energy and provides the basis for a practical range. The bus can cover about one third of transport operators’ relevant routes without intermediate recharging. The first models have already been delivered to customers.");
wrapper.addBlock(p_para, "The Mercedes-Benz eCitaro also marks the launch of an inno- vation offensive whose objective is the rapid and practical electrification of local public transport with buses in cities and large metropolitan areas. Because battery technology is developing at a rapid pace, the eCitaro is already designed to accommodate a transition to future battery technologies such as more powerful lithium-ion batteries or the optional use of solid-state batteries. Plans also call for the eCitaro’s range to be increased through the use of a range extender in the form of a fuel cell that generates electricity.");

wrapper.addBlock(p_headers, "Holistic eMobility Consulting set to redefine urban bus transportation");
wrapper.addBlock(p_para, "The new all-electric eCitaro city bus is part of Daimler Buses’ overall eMobility system. In order to support our custom- ers with the transition to electric bus fleets, our eMobility Consulting team offers advice on request about different use scenarios, taking into account bus route lengths, passenger numbers, energy requirements, range calculations, charging management and other aspects. In addition, our OMNIplus service brand offers a tailored electric mobility service package that includes onsite services at customers’ maintenance and repair shops.");

wrapper.addBlock(p_headers, "Redefining safety with innovative safety and driver assis- tance systems");
wrapper.addBlock(p_para, "With new safety and assistance systems, we are demonstrating that safety has top priority for our buses. Beginning in 2019, the Active Brake Assist 4 emergency braking system will become standard equipment in all Mercedes-Benz and Setra touring coaches. The system warns the driver of potential collisions with pedestrians and automatically initiates emergency braking when it detects stationary or moving obstacles ahead of the vehicle. Preventive Brake Assist – the first active emergency braking assistance system for city buses – will be available as an option for the entire Mercedes-Benz Citaro model family and the Mercedes-Benz Conecto starting in 2019. The new assistance system warns of a potential collision with pedestrians or stationary or moving objects, and automatically initiates braking if there is an imminent risk of collision. Sideguard Assist, which is a radar-based turning assistant with pedestrian detection for buses, supports bus drivers during right turns, which can be dangerous in certain situations. Side- guard Assist is available for all variants of the Mercedes-Benz Citaro and Tourismo and all Setra ComfortClass 500 and Setra TopClass 500 touring coaches.");

wrapper.addBlock().setSpaceBefore(110).setSpaceAfter(110);

// ====================================================================
// 2nd image
// ====================================================================
wrapper.addBlock(p_para)
	.setSpan("all")
	.setTextAlign("center")
	.addExternalGraphic(getFile("image--727.jpg"))
		.setContentWidth(21.0)
		.setScaling("uniform")
		.setPaddingBefore(5)
		.setPaddingAfter(0);

// ====================================================================
// 2nd footer
// ====================================================================

wrapper.addBlock(p_footer, "Efficiency, variability, comfort and safety, exciting design: The new Setra S 531 DT double-decker bus.")
	.setPaddingAfter(20)
	.setPaddingBefore(-4)
	.setSpan("all")
	.setTextAlign("left");

// ====================================================================
// Text 3rd Page
// ====================================================================

wrapper.addBlock(p_headers, "Digital service with OMNIplus ON");
wrapper.addBlock(p_para, "Daimler Buses now also offers digital services with its new OMNIplus ON portal, which integrates existing and new services into four pillars. OMNIplus On advance ensures maximum fleet availability for bus operators, and its Uptime feature helps increase vehicle operating times, for example. OmniPlus On monitor combines telematics services that ensure efficient fleet management operations. OMNIplus On drive supports bus drivers with their departure checks, for example, and OMNIplus On commerce allows bus companies to buy spare parts quickly and directly around the clock in an online shop.");

wrapper.addBlock(p_headers, "Numerous major orders for Daimler Buses – including the first large orders for the all-electric eCitaro");
wrapper.addBlock(p_para, "Daimler Buses received a large number of major orders in the year under review. The cities of Hamburg and Berlin ordered 20 and 15 Mercedes-Benz eCitaro models respectively in 2018. The order from Berlin also included an option to purchase as many as 950 Mercedes-Benz city buses. The framework agreement for the option, which runs for several years, covers the delivery of up to 600 articulated buses and a maximum of 350 solo buses. During the year under review, we were also able to gain major European orders in Poland (150 vehicles for Kraków, GdaƄsk and Bialystok), Spain (EMT Madrid: 270 Citaro buses with natural gas drive to be delivered between 2019 and 2020) and Austria (framework agreement with Blaguss: 250 Setra touring coaches to be delivered between 2019 and 2022). We also received orders in Brazil, including one for 121 city buses that will be used to renew the fleets operated by various bus companies in Curitiba.");

wrapper.addBlock(p_headers, "Award-winning products from Daimler Buses");
wrapper.addBlock(p_para, "The Mercedes-Benz Citaro hybrid, which is available with either a diesel or a natural gas engine, was named “Bus of the Year 2019” by an independent jury. The selection criteria for the award included profitability, innovation, quality and user-friendliness. The Citaro Ü hybrid intercity variant made a big impression in terms of sustainability and was presented with the “Sustain- able Bus Award 2019” for inter-city buses. Four of our buses also captured first place in the 2018 readers’ survey conducted by the EuroTransportMedia (ETM) publishing company. The awards here were in the categories City Bus (Mercedes-Benz Citaro K), Inter- City Bus (Mercedes-Benz Citaro LE), Minibus (Sprinter Minibus) and High-Deck Touring Coach (Setra Top- Class HDH/DT).");

wrapper.addBlock(p_headers, "New sales partner in North America");
wrapper.addBlock(p_para, "REV Coach LLC became the new sales partner for the Setra brand in North America at the beginning of 2018. The company took over from Motor Coach Industries International Inc. (MCI) as the general sales agent for Daimler Buses in the North American market. REV has also been responsible for Setra customer service since July 2018.");

wrapper.addBlock(p_headers, "BusStore pre-owned bus brand celebrates fifth anniversary");
wrapper.addBlock(p_para, "Launched in 2013, the BusStore brand combines and further professionalizes all Mercedes-Benz and Setra activities in the area of used buses. BusStore currently sells approximately 2,000 buses each year. During the year under review, we opened new BusStore locations in Croatia, Hungary, Latvia and Slovakia, which means that BusStore now operates a total of 19 outlets in Europe. We have also launched a pilot project with BusStore Mexico in order to expand our international pre- owned bus sales operations. In addition, plans now call for BusStore locations to be established in other countries as well.");

// ====================================================================
// GENERATE PDF
// ====================================================================

var fop = root.toFOP();
let pdf = new Ax.fop.Processor().transform(fop);
let doc = new Ax.io.File("/tmp/JS_FutureGenerationComputerSystems.pdf");
doc.write(pdf);
return pdf;