1 /*******************************************************************************
2 * Copyright (c) 2007, 2017 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 * Semantum Oy - (#7084) page numbering
12 *******************************************************************************/
13 package org.simantics.modeling.ui.pdf;
16 import java.util.ArrayList;
17 import java.util.Collection;
18 import java.util.HashSet;
19 import java.util.List;
22 import org.simantics.db.common.NamedResource;
23 import org.simantics.db.management.ISessionContext;
24 import org.simantics.export.core.pdf.PageNumbering;
25 import org.simantics.modeling.requests.CollectionResult;
26 import org.simantics.modeling.requests.Node;
27 import org.simantics.project.IProject;
29 public class PDFExportPlan {
32 public ISessionContext sessionContext;
33 public IProject project;
34 public List<NamedResource> selectableModels = new ArrayList<NamedResource>();
35 public NamedResource selection;
36 public Collection<String> recentLocations;
39 public CollectionResult nodes = new CollectionResult();
40 public Set<Node> selectedNodeSet = new HashSet<Node>();
43 //NamedResource model;
44 public File exportLocation;
45 public Collection<Node> selectedNodes;
50 * <code>false</code> to print content as is regardless of whether it goes
51 * outside printed page boundaries. <code>true</code> to scale the content
52 * so that it fills the printed page size and the specified margins. If the
53 * content goes over page boundaries, it is shrunk and if it doesn't fill
54 * the page boundaries, it is scaled up uniformly to fill them either
55 * horizontally or vertically.
57 public boolean fitContentToPageMargins = false;
60 * <code>true</code> to attach TG of the diagram and the model.
62 public boolean attachTG = false;
65 * <code>true</code> to attach Wiki page.
67 public boolean attachWiki = false;
70 * Whether or not to add page numbers to the exported PDF. Default value is
71 * {@value #addPageNumbers}.
75 public boolean addPageNumbers = true;
78 * This is ignored if {@link #addPageNumbers} is <code>false</code>.
80 public PageNumbering.Position pageNumberPosition = PageNumbering.Position.BOTTOM_RIGHT;
83 * This is ignored if {@link #addPageNumbers} is <code>false</code>.
85 public PageNumbering.NumberingFormat pageNumberFormat = PageNumbering.NumberingFormat.PAGE_SLASH_TOTAL_PAGES;
88 public PDFExportPlan(ISessionContext sessionContext, Collection<String> recentLocations) {
89 this.sessionContext = sessionContext;
90 this.recentLocations = recentLocations;