3.6 | |
font-family | |
font-size | |
Text-align | |
Start-indent | |
end-indent |
: font-size=14pt. text-align, , : center, left, right. .
, fop-, . , 3.6 . , , 3.7.
3.7 | |
border-style | |
Border-before-style / border-top-style | |
border-after-style / border-bottom-style | |
Border-start-style / border-left-style | |
border-end-style / border-right-style | |
border-width | |
border-before-width / border-top-width | |
Border-after-width / border-bottom-width | |
Border-start-width / border-left-width | |
Border-end-width / border-right-width |
fo:block-container , . . , XSL 90 , reference-orientation, fo:block-container. position, absolute [4]. , , top. , , .
fo:table . : fo:table-column, fo:table-body, fo:table-row, fo:table-cell [2].
fo:table-column . , . column-number . column-width .
fo:table-body , . . . , , .
fo:table-row . line-height .
fo:table-cell. , , .
|
|
<fo:table>
<fo:table-column column-number="1" column-width="35mm"/>
<fo:table-column column-number="2" column-width="35mm"/>
<fo:table-column column-number="3" column-width="20mm"/>
<fo:table-body font-family="GOST_B" font-size="10pt" text-align="center">
<fo:table-row line-height="5.75mm" >
<fo:table-cell column-number="1" border-style="solid">
<fo:block> . . </fo:block>
</fo:table-cell>
<fo:table-cell column-number="2" border-before-style="solid" border-after-style="solid" border-right-style="solid">
<fo:block> . </fo:block>
</fo:table-cell>
<fo:table-cell column-number="3" border-before-style="solid" border-after-style="solid" border-right-style="solid">
<fo:block> . . </fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-body/>
<fo:table>
, , . , , , . , , , .
fo:table-cell, , , number-columns-spanned number-row-spanned , . column-number , . .
<fo:page-number/> [4].
, . Apache FOP pdf- . , . , fop- , , , . , Apache FOP , , . , , :  . 160 UTF-8.   , & ;. # , 160 .
, Apache FOP . 2.113 75, . PartList , : PRIMECHANIE_1 PRIMECHANIE_2 XML . , . , . PRIMECHANIE. .
|
|
<fo:table-cell border-after-style="solid" border-end-style="solid">
<fo:block font-size="14pt">
<xsl:value-of select="@PRIMECHANIE"/>
</fo:block>
<fo:block-container line-height="3.82mm" position="absolute">
<fo:block font-size="10pt">
<xsl:value-of select="@PRIMECHANIE_1"/>
</fo:block>
</fo:block-container>
<fo:block-container top="3.82mm" line-height="3.82mm" position="absolute">
<fo:block font-size="10pt">
<xsl:value-of select="@PRIMECHANIE_2"/>
</fo:block>
</fo:block-container>
</fo:table-cell>
XSL, 2.113 75, A.
3.4 XML XML
2.113 75 . , . . , , , .
, XSL MSXSL, . , xml- xml-. , , (<line FORM=" "/>), .
++, : MFC Win32API. 4.
3.5 MSXSL Apache FOP
XSLT-, , MSXSL. xml- fo- :
msxsl example.xml example.xsl /o example.fo
msxsl , . Example.xml xml-. Example.xsl xsl-. , . . , . , MSXSL. , , , .
fo-, xml- , Apache FOP pdf-.
World Wide Web fop- 0.20.5. , , , 0.93 [11].
Apache FOP, , . , ( Arial).
1 . (Arial.ttf) Windows fop- ( , C:\fop-0.93\conf\Fonts).
2 . ( ):
java -cp C:\fop-0.93\build\fop.jar;C:\fop-0.93\lib\avalon-framework-4.2.0.jar;C:\fop-0.93\lib\commons-logging-1.0.4.jar;C:\fop-0.93\lib\commons-io-1.1.jar org.apache.fop.fonts.apps.TTFReader -d C:\fop-0.93\conf\Fonts\Arial.ttf C:\fop-0.93\conf\Fonts\Arial.xml
|
|
3 . C:\fop-0.93\conf\fop.xconf, ( <fonts> </fonts>):
<font metrics-url="C:\fop-0.93\conf\Fonts\arial.xml" kerning="yes" embed- url="C:\fop-0.93\conf\Fonts\arial.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
<font-triplet name="ArialMT" style="normal" weight="normal"/>
</font>
FOP :
C:\fop-0.93\fop -c C:\fop-0.93\conf\fop.xconf Example.fo Example.pdf.
, .
, .
.
fo-.
pdf-.
:
- xml-;
- xsl-, ;
- , , Apache FOP;
- MSXSL Apache FOP.
4 XML- , PDF-
4.1
4.1.1
, Microsoft Visual Studio 2010 MFC. Visual C++. , :
- ( , , , );
- File New;
- Project, 4.1;
- , , Visual C++, MFC;
- Templates, MFC Application;
- ( XMLConverter), , , 4.2;
- OK;
- , Application Type, Dialog based;
- Use MFC in a static library ( MFC, , EXE, ), 4.3;
- Finish.
4.1
4.2
4.3
, , View. Resource View. , , Dialog. IDD_XMLCONVERTOR_DIALOG, 4.4.
4.4
, Toolbox. View . : Button, Edit Control, Combo Box, Static Text, List Control. 4.5 Toolbox.
4.5
, , , . , , , , Properties ( 4.6).
|
|
, 4.7. Caption, , .
4.6
4.7
: xml pdf , , , Disabled True. List Control , , View Report. Combo Box, Type Drop List. , Data, _1_gost-B_0-9;_1_gost-B_10-19;_1_gost-B_20-29;. Combo Box. , pdf-, , Read Only True.
, . , , Windows. , , . Visual Studio ON_BN_CLICKED ( Windows Buttom), . , , , . Buttom.
List Control, IDC_LIST1 : LVN_ITEMCHANGED, LVN_DELETEITEM, LVN_ITEMACTIVATE. , . . . , , , Add Event Handler. ( 4.8): ; ( CXMLConverterDlg), ; Function handler name . Add and Edit.
4.8
. , .
CListCtrl *pList = (CListCtrl*) GetDlgItem(IDC_LIST1);
pList->InsertColumn(0,_T(" xml-"),0,370,-1);
pList->InsertColumn(1,_T(""),0,100,-1);
pList->InsertColumn(2,_T(""),0,100,-1);
, GetDlgItem() IDC_LIST1. InsertColumn() . : , , (0 , ), , ( -1, ). _T() Unicode. OnInitDialog(), Windows [6].
IDC_LIST1 : InsertItem() SetItem(). () . . LV_ITEM. : () , , , . : InsertItem() SetItem() [6]. .
CListCtrl *pList = (CListCtrl*) GetDlgItem(IDC_LIST1);
LV_ITEM lvitem;
lvitem.mask = LVIF_TEXT;
lvitem.iItem = 0;
lvitem.iSubItem = 0;
lvitem.pszText = str.GetBuffer();
|
|
lvitem.cchTextMax = lstrlen(str);
pList->InsertItem(&lvitem);
lvitem.iSubItem = 1;
lvitem.pszText = _T(" ");
lvitem.cchTextMax = lstrlen(_T(" "));
pList->SetItem(&lvitem);
LVIF_TEXT . str CString, MFC . , . pszText, lvitem, , , . CString GetBuffer() [6].
List Control, InsertItem() GetItem(). str .
, DeleteItem(), .
CListCtrl *pList = (CListCtrl*) GetDlgItem(IDC_LIST1);
pList->DeleteItem(m_nSelectItem);
m_nSelectItem . List Control DeleteAllItems().
xml-, CFileDialog, MFC. . , . . , , . 0. , , . DoModal(). .
, , . .
CFileDialog fdialog(TRUE,0,_T("*.xml"));
fdialog.DoModal();
pdf-, Windows. BROWSEINFO, , , , .
wchar_t sDir[512];
BROWSEINFO brinfo;
brinfo.hwndOwner = 0;
brinfo.pidlRoot = 0;
brinfo.pszDisplayName = sDir;
brinfo.lpszTitle =_T(" pdf-");
brinfo.ulFlags = BIF_RETURNONLYFSDIRS;
brinfo.lpfn = 0;
brinfo.lParam = 0;
SHBrowseForFolder(&brinfo). LPITEMIDLIST. SHGetPathFromIDList() . .
LPITEMIDLIST pDirList = SHBrowseForFolder(&brinfo);
SHGetPathFromIDList(pDirList,sDir);
4.9.
4.9
, : GetDlgItem() EnableWindow(). . , , FALSE TRUE, . .
GetDlgItem(IDC_BUTTON1)->EnableWindow(FALSE);
, . Resource View ( 4.4) Dialog Add Resource. ( 4.10) Dialog New. . , , 4.11.
4.10
4.11
, . Add Class. CSetting Class name. , , CDialog. Finish. , Setting. , . cpp- . class CSetting CXMLConverterDlg. 4.11 , .
CSitting *pSitting = new CSitting();
pSitting->DoModal();
delete[] pSitting;
, Edit Controll . , Add Variable. , . . 4.12.
4.12
, XMLConverter.
4.1.2 XML XML
xml- xml-. , . . i. , , , xml-. i 0. , <line/> <section/>. . , , , . (<line/> <section/>) . , pdf-, , <line/> <section/> xml- .
.
1 . . i- xml-. <section/>, 2. 5.
2 . , , ( , ) , . , <line/> . 7. , . 3.
3 . , , , , ( , ) , . , <section/> <line/>, , , . . 7. 4.