public class PrepeareDoc extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
TAB_NOT_TO_PROC_STR |
static String |
TAB_TO_PROC_STR |
static String |
TAB_WOUT_HDS_STRING |
static String |
VARIABLE_MARKER |
| Constructor and Description |
|---|
PrepeareDoc() |
| Modifier and Type | Method and Description |
|---|---|
static Long |
createDocAndSaveInArchive(String sInputFilePathOldDocx,
String sOutputDocClassName,
HashMap<String,String> hmMappings,
List<Map<String,String>> lTables,
Map<String,Object> mOptionalParameters,
boolean pdf) |
static Long |
createPdfAndSaveInArchive(String sInputFilePathOldDocx,
String sOutputDocClassName,
HashMap<String,String> hmMappings,
List<Map<String,String>> lTables,
Map<String,Object> mOptionalParameters) |
static Long |
createPdfAndSaveInArchive(String sInputFilePathOldDocx,
String sOutputDocClassName,
Map<String,Object> mMappings,
String sProcessId,
Map<String,Object> mOptionalParameters) |
static Long |
createPdfAndSaveInArchive(String sInputFilePathOldDocx,
String sOutputDocClassName,
String sProcessId,
Map<String,Object> mOptionalParameters) |
static void |
createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
int iTableNr,
org.docx4j.wml.Tbl table,
Map<String,String> mValues,
List<Map<String,Object>> lParagraphProperties) |
static void |
createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
boolean pdf) |
static void |
createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
ColumnGraphicInfo columnGraphicInfo,
org.docx4j.openpackaging.packages.WordprocessingMLPackage template,
boolean pdf)
Metoda, która na podstawie mapy tworzy wypełnioną tabelę w szablonie docx.
|
static void |
createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
org.docx4j.wml.TrPr rowProperties,
boolean pdf) |
static void |
createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
org.docx4j.wml.TrPr rowProperties,
ColumnGraphicInfo columnGraphicInfo,
org.docx4j.openpackaging.packages.WordprocessingMLPackage template,
boolean pdf) |
static File |
doc2PdfWithoutOO(String sInputFilePathDocx,
String sOutputFilePathPdf)
Metoda, która generuje dokument .pdf z podanego w parametrach pliku .docx bez użycia
OpenOfficeService
|
static File |
doc2PdfWithoutOO(WfFile inputFile,
String sOutputFilePathPdf)
Metoda, która generuje dokument .pdf z podanego w parametrach pliku .docx bez użycia
OpenOfficeService.
|
static String |
mergeVariablesTextNodes(String sTemplate,
String sVariablesMarker,
Map<String,Object> variables) |
static File |
prepareDocument(String outputFilePath,
Map<String,Object> mappings,
List<Map<String,String>> tablesMaps,
String variablesMarker,
String processId,
List<Boolean> tablesAdditionalFlags,
List<Boolean> headersAdditionalFlags,
boolean pdf,
Long fileId) |
static File |
prepareDocument(String templatePath,
String outputFilePath,
Map<String,Object> mappings,
List<Map<String,String>> tablesMaps,
String variablesMarker,
String processId,
List<Boolean> tablesAdditionalFlags,
List<Boolean> headersAdditionalFlags,
boolean pdf) |
static void |
prepareHeaderFooter(org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage,
Map<String,Object> mappings,
String sVariablesMarker) |
static File |
prepeareWordDocument(String templatePath,
String outputFilePath,
Map<String,Object> mappings,
List<Map<String,String>> tables,
String variablesMarker,
String processId,
List<Boolean> headersAdditionalFlags,
List<Boolean> tablesAdditionalFlags)
Metoda, która z podanego szablonu (np. szablon.docx) tworzy nowy dokument szablon_tmp.docx, z
wypełnionymi
zmiennymi (zmienne w szablonie należy podawać w pomiędzy znacznikami, które są zdefiniowane
jako sVariablesMarker
Nie należy w szablonie wykorzystywać tych znaczników, w innym celu niż zaznaczanie zmiennych
(w innych
fragmentach szablonu).
|
static String |
replaceVariablesInTemplate(String template,
Map<String,Object> mappings,
String variablesMarker) |
public static final String TAB_TO_PROC_STR
public static final String TAB_NOT_TO_PROC_STR
public static final String TAB_WOUT_HDS_STRING
public static final String VARIABLE_MARKER
public static File prepeareWordDocument(String templatePath, String outputFilePath, Map<String,Object> mappings, List<Map<String,String>> tables, String variablesMarker, String processId, List<Boolean> headersAdditionalFlags, List<Boolean> tablesAdditionalFlags)
templatePath - - ścieżka do szablonuoutputFilePath - - ścieżka do pdfu, który będzie utworzony przez inną metodęmappings - - mapa przechowująca w kluczach nazwy zmiennych wyszukiwane w dokumencie, a w
wartościach to
czym mające te zmienne zostać zastąpionetables - - lista map, definiująca tabele znajdujące się w dokumencie, każda tabela to
osobna mapa, której
klucze wskazują kolumnę (tNR_TABELIcNR_KOLUMNY np. t1c1), a w wartości po
średnikach wartości w
zadanej kolumnie, dla kojelnych wierszy (np. wartosc1;wartosc2;wartosc3;...)variablesMarker - - zmienna przechowująca ciąg znaków będący znacznikiem umożliwiającym
rozpoznanie w w
dokumencie zmiennych, które mają zostać zastąpione wartościami (ze względu na
działania MSWord ciąg
znaków rozumiem tutaj jako jeden znak np. "@")processId - - id procesuheadersAdditionalFlags - - flagi stanowiące o tym, czy dane konkretnego nagłówka mają
zostać pobranetablesAdditionalFlags - - flagi stanowiące o tym, czy dane konkretnej tabeli mają zostać
pobraneIOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionJAXBExceptionpublic static File prepareDocument(String outputFilePath, Map<String,Object> mappings, List<Map<String,String>> tablesMaps, String variablesMarker, String processId, List<Boolean> tablesAdditionalFlags, List<Boolean> headersAdditionalFlags, boolean pdf, Long fileId)
public static File prepareDocument(String templatePath, String outputFilePath, Map<String,Object> mappings, List<Map<String,String>> tablesMaps, String variablesMarker, String processId, List<Boolean> tablesAdditionalFlags, List<Boolean> headersAdditionalFlags, boolean pdf)
public static void prepareHeaderFooter(org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage,
Map<String,Object> mappings,
String sVariablesMarker)
public static void createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
ColumnGraphicInfo columnGraphicInfo,
org.docx4j.openpackaging.packages.WordprocessingMLPackage template,
boolean pdf)
mdp - - pobrany z szablony główny człon dokumentu docxtable - - pobrany element z xmla definiującego dokument docx, opisujący tabelęlValues - - mapa której klucze wskazują kolumnę (tNR_TABELIcNR_KOLUMNY np. t1c1), a w
wartości po średnikach
wartości w zadanej kolumnie, dla kojelnych wierszy (np.
wartosc1;wartosc2;wartosc3;...)columnGraphicInfo - template - org.docx4j.openpackaging.exceptions.Docx4JExceptionJAXBExceptionpublic static File doc2PdfWithoutOO(WfFile inputFile, String sOutputFilePathPdf) throws IOException
inputFile - - plik (docx - uzupełniony szablon), z którego ma
zostać stworzony .pdfIOExceptionpublic static File doc2PdfWithoutOO(String sInputFilePathDocx, String sOutputFilePathPdf)
sInputFilePathDocx - - ścieżka do pliku (docx - uzupełniony szablon), z którego ma
zostać stworzony .pdfpublic static String replaceVariablesInTemplate(String template, Map<String,Object> mappings, String variablesMarker)
public static String mergeVariablesTextNodes(String sTemplate, String sVariablesMarker, Map<String,Object> variables)
public static Long createPdfAndSaveInArchive(String sInputFilePathOldDocx, String sOutputDocClassName, HashMap<String,String> hmMappings, List<Map<String,String>> lTables, Map<String,Object> mOptionalParameters)
public static Long createDocAndSaveInArchive(String sInputFilePathOldDocx, String sOutputDocClassName, HashMap<String,String> hmMappings, List<Map<String,String>> lTables, Map<String,Object> mOptionalParameters, boolean pdf)
public static Long createPdfAndSaveInArchive(String sInputFilePathOldDocx, String sOutputDocClassName, String sProcessId, Map<String,Object> mOptionalParameters)
public static Long createPdfAndSaveInArchive(String sInputFilePathOldDocx, String sOutputDocClassName, Map<String,Object> mMappings, String sProcessId, Map<String,Object> mOptionalParameters)
public static void createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
boolean pdf)
public static void createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
org.docx4j.wml.TrPr rowProperties,
boolean pdf)
public static void createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
int iTableNr,
org.docx4j.wml.Tbl table,
Map<String,String> mValues,
List<Map<String,Object>> lParagraphProperties)
public static void createTableWithValues(org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart mdp,
org.docx4j.wml.Tbl table,
List<String> lValues,
List<Map<String,Object>> lParagraphProperties,
org.docx4j.wml.TrPr rowProperties,
ColumnGraphicInfo columnGraphicInfo,
org.docx4j.openpackaging.packages.WordprocessingMLPackage template,
boolean pdf)
Copyright © 2023 Suncode. All rights reserved.