Commit c12f4518 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@61918 954022d7-b5bf-4e40-9824-e11837661b57
parent 0eedfe82
......@@ -295,6 +295,61 @@ ASCOfficePDFReader/Resources/n022004l.crpt svn_mime_002dtype=application%2Foctet
ASCOfficePDFReader/Resources/n022023l.crpt svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFReader/Resources/n022024l.crpt svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFReader/Resources/s050000l.crpt svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Linux svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/PdfWriterLib svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/PdfWriterLib/Linux svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/PdfWriterLib/Win32 svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient/Properties svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient/bin svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient/bin/AxInterop.AcroPDFLib.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Interop.ASCOfficePDFWriter.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Interop.AVSGraphics.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Interop.AVSMediaCore3.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Interop.AVSOfficePDFWriter.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Interop.AcroPDFLib.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Interop.Acrobat.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/PdfWriter.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/PdfWriter.pdb svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Test.exe svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/Test.pdb svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/bin/files svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient/bin/files/PDF.pdf svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/AxInterop.AcroPDFLib.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/DesignTimeResolveAssemblyReferences.cache svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Interop.ASCOfficePDFWriter.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Interop.AVSGraphics.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Interop.AVSMediaCore3.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Interop.AVSOfficePDFWriter.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Interop.AcroPDFLib.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Interop.Acrobat.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/TempPE svnc_tsvn_003alogminsize=5
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Test.MainForm.resources svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Test.Properties.Resources.resources svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Test.exe svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/Test.pdb svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/TestGradient.csproj.GenerateResource.Cache svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/TestGradient.csproj.ResolveComReference.cache svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestGradient/obj/Debug/TestGradient.csprojResolveAssemblyReference.cache svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/AxInterop.AcroPDFLib.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Interop.AVSGraphics.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Interop.AVSMediaCore3.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Interop.AVSOfficePDFWriter.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Interop.AcroPDFLib.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Interop.Acrobat.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/PdfWriter.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/PdfWriter.pdb svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/SciLexer.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/SciLexer64.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/ScintillaNET.dll svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Test.exe svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Test.pdb svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/files/coffe.jpg svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Win32 svnc_tsvn_003alogminsize=5
ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/xls-xlsx.odp svn_mime_002dtype=application%2Foctet-stream
ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/xls-xlsx_short.odp svn_mime_002dtype=application%2Foctet-stream
ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/Презентация[!!-~]конвертера[!!-~]XLSX.doc svn_mime_002dtype=application%2Foctet-stream
......
#include "../PdfWriterLib/PdfWriterLib.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../version.h"
int main(int argc, char *argv[])
{
CPdfWriterLib pdfWriter;
// check arguments
if (argc < 3)
{
// print out help topic
std::cout << std::endl;
std::cout << std::endl;
std::cout << "-------------------------------------------------------------------------------" << std::endl;
std::cout << "\t\tASCPdfWriter (Version: " << STRVER << ")" << std::endl;
std::cout << "-------------------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
std::cout << "USAGE: ASCPdfWriter \"path_to_file_1\" \"path_to_file_2\" [\"path_to_font_selection\"] " << std::endl;
std::cout << "WHERE:" << std::endl;
std::cout << "\t\"path_to_file_1\" is a path to file to be converted" << std::endl;
std::cout << "\t\"path_to_file_2\" is a path to the PDF output file" << std::endl;
std::cout << "\t\"path_to_font_selection\" is a path to 'font_selection.bin' location" << std::endl;
return 1;
}
CString pathBin = argv[1];
CString pathPdf = argv[2];
CString pathFonts;
if (argc > 3) pathFonts = argv[3];
else
pathFonts = FileSystem::Directory::GetFolderPath(pathBin) + FILE_SEPARATOR_STR + _T("Fonts");
pdfWriter.SetFontDir(pathFonts);
pdfWriter.OnlineWordToPdf(pathBin, pathPdf, 1);
return 0;
}
#-------------------------------------------------
#
# Project created by QtCreator 2015-02-18T19:17:07
#
#-------------------------------------------------
QT -= core
QT -= gui
linux-g++{
#64bit
TARGET = ASCPdfWriter
}
else{
#32bit
TARGET = ASCPdfWriter32
}
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wno-ignored-qualifiers
DEFINES += UNICODE \
_UNICODE \
LINUX \
_LINUX_QT \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
BUILD_CONFIG_FULL_VERSION \
FILTER_FLATE_DECODE_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
INCLUDEPATH += /usr/include/libxml2
INCLUDEPATH += ../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../PdfWriterLib/Linux
SOURCES += PdfWriter.cpp
CONFIG(debug, debug|release){
message(Debug)
linux-g++{
message(64 bit)
unix:!macx: LIBS += -L$$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop64-Debug/ -lPdfWriterLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop64-Debug/libPdfWriterLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop64-Debug/ -lASCOfficeUtilsLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop64-Debug/libASCOfficeUtilsLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop64-Debug/ -lgraphics
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop64-Debug/libgraphics.a
}
else{
message(32 bit)
unix:!macx: LIBS += -L$$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop-Debug/ -lPdfWriterLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop-Debug/libPdfWriterLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Debug/ -lASCOfficeUtilsLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Debug/libASCOfficeUtilsLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Debug/ -lgraphics
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Debug/libgraphics.a
}
}
CONFIG(release, debug|release){
message(Release)
linux-g++{
message(64 bit)
unix:!macx: LIBS += -L$$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop64-Release/ -lPdfWriterLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop64-Release/libPdfWriterLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop64-Release/ -lASCOfficeUtilsLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop64-Release/libASCOfficeUtilsLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop64-Release/ -lgraphics
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop64-Release/libgraphics.a
}
else{
message(32 bit)
unix:!macx: LIBS += -L$$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop-Release/ -lPdfWriterLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../PdfWriterLib/Linux/build-PdfWriterLib-Desktop-Release/libPdfWriterLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Release/ -lASCOfficeUtilsLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Release/libASCOfficeUtilsLib.a
unix:!macx: LIBS += -L$$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Release/ -lgraphics
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ServerComponents/DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Release/libgraphics.a
}
}
unix:!macx: LIBS += -lxml2

#include "Annotation.h"
//------ AnnotationObject -------------------------------------------------------------------------
const static char *ANNOT_TYPE_NAMES[] =
{
"Text",
"Link",
"Sound",
"FreeText",
"Stamp",
"Square",
"Circle",
"StrikeOut",
"Highlight",
"Underline",
"Ink",
"FileAttachment",
"Popup"
};
const static char *ANNOT_ICON_NAMES_NAMES[] =
{
"Comment",
"Key",
"Note",
"Help",
"NewParagraph",
"Paragraph",
"Insert"
};
//------ Внутренние функции -----------------------------------------------------------------------
Annotation AnnotationNew (MMgr oMMgr, Xref pXref, AnnotType eType, TRect oRect)
{
Annotation pAnnot = NULL;
Array oArray;
unsigned long nRet = OK;
float fTemp = 0.0;
pAnnot = DictNew( oMMgr );
if ( !pAnnot )
return NULL;
if ( OK != XrefAdd( pXref, pAnnot ) )
return NULL;
oArray = ArrayNew( oMMgr );
if ( !oArray )
return NULL;
if ( OK != DictAdd( pAnnot, "Rect", oArray) )
return NULL;
if ( oRect.fTop < oRect.fBottom )
{
fTemp = oRect.fTop;
oRect.fTop = oRect.fBottom;
oRect.fBottom = fTemp;
}
nRet += ArrayAddReal( oArray, oRect.fLeft);
nRet += ArrayAddReal( oArray, oRect.fBottom);
nRet += ArrayAddReal( oArray, oRect.fRight);
nRet += ArrayAddReal( oArray, oRect.fTop);
nRet += DictAddName( pAnnot, "Type", "Annot" );
nRet += DictAddName( pAnnot, "Subtype", ANNOT_TYPE_NAMES[ (int)eType ] );
if ( OK != nRet )
return NULL;
pAnnot->pHeader.nObjClass |= OSUBCLASS_ANNOTATION;
return pAnnot;
}
Annotation LinkAnnotNew (MMgr oMMgr, Xref pXref, TRect oRect, Destination pDst)
{
Annotation pAnnot = NULL;
pAnnot = AnnotationNew( oMMgr, pXref, AnnotLink, oRect);
if ( !pAnnot )
return NULL;
if ( OK != DictAdd( pAnnot, "Dest", pDst ) )
return NULL;
return pAnnot;
}
Annotation URILinkAnnotNew (MMgr oMMgr, Xref pXref, TRect oRect, const char *sUri)
{
Annotation pAnnot = NULL;
Dict pAction;
unsigned long nRet = 0;
pAnnot = AnnotationNew( oMMgr, pXref, AnnotLink, oRect);
if ( !pAnnot )
return NULL;
pAction = DictNew( oMMgr );
if ( !pAction )
return NULL;
nRet = DictAdd( pAnnot, "A", pAction );
if ( OK != nRet )
return NULL;
nRet += DictAddName( pAction, "Type", "Action");
nRet += DictAddName( pAction, "S", "URI");
nRet += DictAdd( pAction, "URI", StringNew( oMMgr, sUri, NULL ) );
if ( OK != nRet )
return NULL;
return pAnnot;
}
Annotation TextAnnotNew (MMgr oMMgr, Xref pXref, TRect oRect, const char *sText, EncoderRecPtr pEncoder)
{
Annotation pAnnot = NULL;
String oString;
pAnnot = AnnotationNew( oMMgr, pXref, AnnotTextNotes, oRect );
if ( !pAnnot )
return NULL;
oString = StringNew( oMMgr, sText, pEncoder);
if ( !oString )
return NULL;
if ( OK != DictAdd( pAnnot, "Contents", oString ) )
return NULL;
return pAnnot;
}
BOOL AnnotationValidate (Annotation pAnnot )
{
if ( !pAnnot )
return FALSE;
if ( pAnnot->pHeader.nObjClass != (OSUBCLASS_ANNOTATION | OCLASS_DICT) )
return FALSE;
return TRUE;
}
static BOOL CheckSubType (Annotation pAnnot, AnnotType eType )
{
Name oSubtype;
if ( !AnnotationValidate( pAnnot ) )
return FALSE;
oSubtype = (Name)DictGetItem( pAnnot, "Subtype", OCLASS_NAME );
if ( !oSubtype || UtilsStrCmp( oSubtype->sValue, ANNOT_TYPE_NAMES[ (int)eType ] ) != 0 )
{
RaiseError( pAnnot->oError, AVS_OFFICEPDFWRITER_ERROR_INVALID_ANNOTATION, 0 );
return FALSE;
}
return TRUE;
}
//------ Внешние функции --------------------------------------------------------------------------
unsigned long AnnotationSetBorderStyle (Annotation pAnnot, BSSubtype eSubtype, float fWidth, unsigned short nDashOn, unsigned short nDashOff, unsigned short nDashPhase)
{
Dict pBorderStyle = NULL;
Array oDash;
unsigned long nRet = OK;
pBorderStyle = DictNew( pAnnot->oMMgr );
if ( !pBorderStyle )
return ErrorGetCode( pAnnot->oError );
if ( OK != ( nRet = DictAdd( pAnnot, "BS", pBorderStyle ) ) )
return nRet;
if ( BSDashed == eSubtype )
{
oDash = ArrayNew( pAnnot->oMMgr );
if ( !oDash )
return ErrorGetCode( pAnnot->oError );
if ( OK != ( nRet = DictAdd( pBorderStyle, "D", oDash ) ) )
return nRet;
nRet += DictAddName( pBorderStyle, "Type", "Border" );
nRet += ArrayAddReal( oDash, nDashOn );
nRet += ArrayAddReal( oDash, nDashOff );
if ( 0 != nDashPhase )
nRet += ArrayAddReal( oDash, nDashOff );
}
switch ( eSubtype )
{
case BSSolid:
nRet += DictAddName( pBorderStyle, "S", "S");
break;
case BSDashed:
nRet += DictAddName( pBorderStyle, "S", "D");
break;
case BSBeveled:
nRet += DictAddName( pBorderStyle, "S", "B");
break;
case BSInset:
nRet += DictAddName( pBorderStyle, "S", "I");
break;
case BSUnderlined:
nRet += DictAddName( pBorderStyle, "S", "U");
break;
default:
return SetError( pAnnot->oError, AVS_OFFICEPDFWRITER_ERROR_ANNOT_INVALID_BORDER_STYLE, 0);
}
if ( BS_DEF_WIDTH != fWidth )
nRet += DictAddReal( pBorderStyle, "W", fWidth );
if ( OK != nRet )
return ErrorGetCode( pAnnot->oError );
return OK;
}
unsigned long LinkAnnotSetBorderStyle (Annotation pAnnot, float fWidth, unsigned short nDashOn, unsigned short nDashOff )
{
Array oArray;
unsigned long nRet = OK;
if ( !CheckSubType( pAnnot, AnnotLink ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_ANNOTATION;
if ( fWidth < 0 )
return RaiseError( pAnnot->oError, AVS_OFFICEPDFWRITER_ERROR_INVALID_PARAMETER, 0 );
oArray = ArrayNew( pAnnot->oMMgr );
if ( !oArray )
return CheckError( pAnnot->oError );
if ( OK != ( nRet = DictAdd( pAnnot, "Border", oArray ) ) )
return CheckError( pAnnot->oError );
nRet += ArrayAddNumber( oArray, 0 );
nRet += ArrayAddNumber( oArray, 0 );
nRet += ArrayAddReal( oArray, fWidth );
if ( OK != nRet )
return CheckError( pAnnot->oError );
if ( nDashOn && nDashOff )
{
Array oDash = ArrayNew( pAnnot->oMMgr );
if ( !oDash )
return CheckError( pAnnot->oError );
if ( OK != ( nRet = ArrayAdd( oArray, oDash ) ) )
return CheckError( pAnnot->oError );
nRet += ArrayAddNumber( oDash, nDashOn );
nRet += ArrayAddNumber( oDash, nDashOff );
}
if ( OK != nRet )
return CheckError( pAnnot->oError );
return nRet;
}
unsigned long LinkAnnotSetHighlightMode (Annotation pAnnot, AnnotHighlightMode eMode)
{
unsigned long nRet = OK;
if ( !CheckSubType( pAnnot, AnnotLink ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_ANNOTATION;
switch ( eMode )
{
case AnnotNoHighlight:
nRet = DictAddName( pAnnot, "H", "N");
break;
case AnnotInvertBorder:
nRet = DictAddName( pAnnot, "H", "O");
break;
case AnnotDownAppearance:
nRet = DictAddName( pAnnot, "H", "P");
break;
default: /* AnnotInvertBox */
/* default value */
DictRemoveElement( pAnnot, "H");
nRet = OK;
}
if ( OK != nRet )
return CheckError( pAnnot->oError );
return nRet;
}
unsigned long TextAnnotSetIcon (Annotation pAnnot, AnnotIcon eIcon)
{
if ( !CheckSubType( pAnnot, AnnotTextNotes ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_ANNOTATION;
if ( eIcon < 0 || eIcon >= AnnotIconEOF )
return RaiseError( pAnnot->oError, AVS_OFFICEPDFWRITER_ERROR_ANNOT_INVALID_ICON, (unsigned long)eIcon);
if ( DictAddName( pAnnot, "Name", ANNOT_ICON_NAMES_NAMES[ (int)eIcon ] ) != OK )
return CheckError( pAnnot->oError );
return OK;
}
unsigned long TextAnnotSetOpened (Annotation pAnnot, BOOL bOpened)
{
BooleanRecPtr oBool;
if ( !CheckSubType( pAnnot, AnnotTextNotes ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_ANNOTATION;
oBool = BooleanNew( pAnnot->oMMgr, bOpened );
if ( !oBool )
return CheckError( pAnnot->oError );
return DictAdd( pAnnot, "Open", oBool );
}
#ifndef _ANNOTATION_H
#define _ANNOTATION_H
#pragma once
#include "Objects.h"
Annotation LinkAnnotNew (MMgr oMMgr, Xref pXref, TRect oRect, Destination pDst);
Annotation TextAnnotNew (MMgr oMMgr, Xref pXref, TRect oRect, const char *sText, EncoderRecPtr pEncoder);
Annotation URILinkAnnotNew (MMgr oMMgr, Xref pXref, TRect oRect, const char *sUri);
//------ Внешние функции --------------------------------------------------------------------------
unsigned long AnnotationSetBorderStyle (Annotation pAnnot, BSSubtype eSubtype, float fWidth, unsigned short nDashOn, unsigned short nDashOff, unsigned short nDashPhase);
unsigned long LinkAnnotSetBorderStyle (Annotation pAnnot, float fWidth, unsigned short nDashOn, unsigned short nDashOff );
unsigned long LinkAnnotSetHighlightMode (Annotation pAnnot, AnnotHighlightMode eMode);
unsigned long TextAnnotSetIcon (Annotation pAnnot, AnnotIcon eIcon);
unsigned long TextAnnotSetOpened (Annotation pAnnot, BOOL bOpened);
#endif /* _ANNOTATION_H */
\ No newline at end of file
#include "Catalog.h"
Catalog CatalogNew (MMgr oMMgr, Xref pXref)
{
Catalog pCatalog;
unsigned long nRet = OK;
pCatalog = DictNew( oMMgr );
if ( !pCatalog )
return NULL;
pCatalog->pHeader.nObjClass |= OSUBCLASS_CATALOG;
if ( OK != XrefAdd( pXref, pCatalog ) )
return NULL;
// добавляем необходимые элементы
nRet += DictAddName( pCatalog, "Type", "Catalog");
nRet += DictAdd( pCatalog, "Pages", PagesNew( oMMgr, NULL, pXref ) );
if ( OK != nRet )
return NULL;
return pCatalog;
}
Pages CatalogGetRoot (Catalog pCatalog)
{
Dict pPages;
if ( !pCatalog )
return NULL;
pPages = (Dict)DictGetItem( pCatalog, "Pages", OCLASS_DICT);
if ( !pPages || pPages->pHeader.nObjClass != (OSUBCLASS_PAGES | OCLASS_DICT) )
SetError( pCatalog->oError, AVS_OFFICEPDFWRITER_ERROR_PAGE_CANNOT_GET_ROOT_PAGES, 0 );
return pPages;
}
PageLayout CatalogGetPageLayout (Catalog pCatalog)
{
Name oLayout;
unsigned int nIndex = 0;
oLayout = (Name)DictGetItem( pCatalog, "PageLayout", OCLASS_NAME);
if ( !oLayout )
return PLEOF;
while ( PAGE_LAYOUT_NAMES[nIndex] )
{
if ( UtilsStrCmp( oLayout->sValue, PAGE_LAYOUT_NAMES[nIndex] ) == 0 )
return (PageLayout)nIndex;
nIndex++;
}
return PLEOF;
}
unsigned long CatalogSetPageLayout (Catalog pCatalog, PageLayout eLayout)
{
return DictAddName( pCatalog, "PageLayout", PAGE_LAYOUT_NAMES[ (int)eLayout ] );
}
PageMode CatalogGetPageMode (Catalog pCatalog)
{
Name oMode;
unsigned int nIndex = 0;
oMode = (Name)DictGetItem( pCatalog, "PageMode", OCLASS_NAME );
if ( !oMode )
return PageModeUseNone;
while ( PAGE_MODE_NAMES[nIndex] )
{
if ( UtilsStrCmp( oMode->sValue, PAGE_MODE_NAMES[nIndex] ) == 0 )
return (PageMode)nIndex;
nIndex++;
}
return PageModeUseNone;
}
unsigned long CatalogSetPageMode (Catalog pCatalog, PageMode eMode)
{
return DictAddName( pCatalog, "PageMode", PAGE_MODE_NAMES[ (int)eMode ] );
}
unsigned long CatalogSetOpenAction (Catalog pCatalog, Destination pOpenAction)
{
if ( !pOpenAction )
{
DictRemoveElement( pCatalog, "OpenAction" );
return OK;
}
return DictAdd( pCatalog, "OpenAction", pOpenAction );
}
unsigned long CatalogAddPageLabel (Catalog pCatalog, unsigned int nPageNum, Dict pPageLabel)
{
unsigned long nRet = OK;
Array oNums;
Dict pLabels = (Dict)DictGetItem( pCatalog, "PageLabels", OCLASS_DICT);
if ( !pLabels )
{
pLabels = DictNew( pCatalog->oMMgr );
if ( !pLabels )
return pCatalog->oError->nErrorNo;
if ( OK != ( nRet = DictAdd( pCatalog, "PageLabels", pLabels ) ) )
return nRet;
}
oNums = (Array)DictGetItem( pLabels, "Nums", OCLASS_ARRAY );
if ( !oNums )
{
oNums = ArrayNew( pCatalog->oMMgr );
if ( !oNums )
return pCatalog->oError->nErrorNo;
if ( OK != ( nRet = DictAdd( pLabels, "Nums", oNums ) ) )
return nRet;
}
if ( OK != ( nRet = ArrayAddNumber( oNums, nPageNum ) ) )
return nRet;
return ArrayAdd( oNums, pPageLabel);
}
unsigned int CatalogGetViewerPreference(Catalog pCatalog)
{
Dict pPreferences;
unsigned int nValue = 0;
BooleanRecPtr oBool;
pPreferences = (Dict)DictGetItem( pCatalog, "ViewerPreferences", OCLASS_DICT);
if ( !pPreferences )
return 0;
oBool = (BooleanRecPtr)DictGetItem( pPreferences, "HideToolbar", OCLASS_BOOLEAN);
if ( oBool )
{
if ( oBool->bValue )
nValue += HIDE_TOOLBAR;
}
oBool = (BooleanRecPtr)DictGetItem( pPreferences, "HideMenubar", OCLASS_BOOLEAN);
if ( oBool )
{
if ( oBool->bValue )
nValue += HIDE_MENUBAR;
}
oBool = (BooleanRecPtr)DictGetItem( pPreferences, "HideWindowUI", OCLASS_BOOLEAN);
if ( oBool )
{
if ( oBool->bValue )
nValue += HIDE_WINDOW_UI;
}
oBool = (BooleanRecPtr)DictGetItem( pPreferences, "FitWindow", OCLASS_BOOLEAN);
if ( oBool )
{
if ( oBool->bValue )
nValue += FIT_WINDOW;
}
oBool = (BooleanRecPtr)DictGetItem( pPreferences, "CenterWindow", OCLASS_BOOLEAN);
if ( oBool )
{
if ( oBool->bValue )
nValue += CENTER_WINDOW;
}
return nValue;
}
unsigned long CatalogSetViewerPreference(Catalog pCatalog, unsigned int nValue)
{
unsigned long nRet = OK;
Dict pPreferences = NULL;
if ( !nValue )
{
nRet = DictRemoveElement( pCatalog, "ViewerPreferences" );
if ( AVS_OFFICEPDFWRITER_ERROR_DICT_ITEM_NOT_FOUND == nRet )
nRet = OK;
return nRet;
}
pPreferences = DictNew( pCatalog->oMMgr );
if ( !pPreferences )
return pCatalog->oError->nErrorNo;
if ( OK != ( nRet = DictAdd( pCatalog, "ViewerPreferences", pPreferences ) ) )
return nRet;
/* */
if ( nValue & HIDE_TOOLBAR)
{
if ( OK != ( nRet = DictAddBoolean( pPreferences, "HideToolbar", TRUE ) ) )
return nRet;
}
else
{
if ( OK != ( nRet = DictRemoveElement( pPreferences, "HideToolbar" ) ) )
if ( AVS_OFFICEPDFWRITER_ERROR_DICT_ITEM_NOT_FOUND != nRet )
return nRet;
}
if ( nValue & HIDE_MENUBAR)
{
if ( OK != ( nRet = DictAddBoolean( pPreferences, "HideMenubar", TRUE ) ) )
return nRet;
}
else
{
if ( OK != ( nRet = DictRemoveElement( pPreferences, "HideMenubar" ) ) )
if ( AVS_OFFICEPDFWRITER_ERROR_DICT_ITEM_NOT_FOUND != nRet )
return nRet;
}
if ( nValue & HIDE_WINDOW_UI )
{
if ( OK != ( nRet = DictAddBoolean( pPreferences, "HideWindowUI", TRUE ) ) )
return nRet;
}
else
{
if ( OK != ( nRet = DictRemoveElement( pPreferences, "HideWindowUI" ) ) )
if ( AVS_OFFICEPDFWRITER_ERROR_DICT_ITEM_NOT_FOUND != nRet )
return nRet;
}
if ( nValue & FIT_WINDOW )
{
if ( OK != ( nRet = DictAddBoolean( pPreferences, "FitWindow", TRUE ) ) )
return nRet;
}
else
{
if ( OK != ( nRet = DictRemoveElement( pPreferences, "FitWindow" ) ) )
if ( AVS_OFFICEPDFWRITER_ERROR_DICT_ITEM_NOT_FOUND != nRet )
return nRet;
}
if ( nValue & CENTER_WINDOW )
{
if ( OK != ( nRet = DictAddBoolean( pPreferences, "CenterWindow", TRUE ) ) )
return nRet;
}
else
{
if ( OK != ( nRet = DictRemoveElement( pPreferences, "CenterWindow" ) ) )
if ( AVS_OFFICEPDFWRITER_ERROR_DICT_ITEM_NOT_FOUND != nRet )
return nRet;
}
return OK;
}
BOOL CatalogValidate (Catalog pCatalog)
{
if ( !pCatalog )
return FALSE;
if ( pCatalog->pHeader.nObjClass != (OSUBCLASS_CATALOG | OCLASS_DICT) )
{
SetError( pCatalog->oError, AVS_OFFICEPDFWRITER_ERROR_INVALID_OBJECT, 0);
return FALSE;
}
return TRUE;
}
#ifndef _CATALOG_H
#define _CATALOG_H
#pragma once
#include "Objects.h"
#include "Pages.h"
static const char *PAGE_LAYOUT_NAMES[] =
{
"SinglePage",
"OneColumn",
"TwoColumnLeft",
"TwoColumnRight",
NULL
};
static const char *PAGE_MODE_NAMES[] =
{
"UseNone",
"UseOutlines",
"UseThumbs",
"FullScreen",
"UseOC",
"UseAttachments",
NULL
};
//-------- CatalogObject ----------------------------------------------------
typedef Dict Catalog;
Catalog CatalogNew (MMgr oMMgr, Xref pXref);
Pages CatalogGetRoot (Catalog pCatalog);
PageLayout CatalogGetPageLayout (Catalog pCatalog);
unsigned long CatalogSetPageLayout (Catalog pCatalog, PageLayout eLayout);
PageMode CatalogGetPageMode (Catalog pCatalog);
unsigned long CatalogSetPageMode (Catalog pCatalog, PageMode eMode);
unsigned long CatalogSetOpenAction (Catalog pCatalog, Destination pOpenAction);
unsigned long CatalogAddPageLabel (Catalog pCatalog, unsigned int nPageNum, Dict pPageLabel);
unsigned int CatalogGetViewerPreference(Catalog pCatalog);
unsigned long CatalogSetViewerPreference(Catalog pCatalog, unsigned int nValue);
BOOL CatalogValidate (Catalog pCatalog);
#endif /* _CATALOG_H */
#include "Common.h"
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
#include "Destination.h"
const char *c_asDestinationType[] =
{
"XYZ",
"Fit",
"FitH",
"FitV",
"FitR",
"FitB",
"FitBH",
"FitBV",
NULL
};
BOOL PageValidate (Page pPage);
//----- DestinationObject -----------------------------------------------------------------------
Destination DestinationNew (MMgr oMMgr, Page pTarget, Xref pXref)
{
Destination pDst = NULL;
if ( !PageValidate( pTarget) )
{
SetError( oMMgr->oError, AVS_OFFICEPDFWRITER_ERROR_INVALID_PAGE, 0 );
return NULL;
}
pDst = ArrayNew( oMMgr );
if ( !pDst )
return NULL;
pDst->pHeader.nObjClass |= OSUBCLASS_DESTINATION;
if ( OK != XrefAdd( pXref, pDst ) )
return NULL;
// первый элемент массива должен быть страницей, которой принадлежит объект
if ( OK != ArrayAdd( pDst, pTarget ) )
return NULL;
// default type = Fit
if ( OK != ArrayAddName( pDst, c_asDestinationType[ (int)Fit ] ) )
return NULL;
return pDst;
}
BOOL DestinationValidate (Destination pDst)
{
ObjHeader *pHeader = (ObjHeader *)pDst;
Page pTarget = NULL;
if ( !pDst || pHeader->nObjClass != (OCLASS_ARRAY | OSUBCLASS_DESTINATION) )
return FALSE;
// тип Destination не определен.
if ( pDst->pList->nCount < 2 )
return FALSE;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( !PageValidate( pTarget ) )
return SetError( pDst->oError, AVS_OFFICEPDFWRITER_ERROR_INVALID_PAGE, 0 );
return TRUE;
}
//----- Внешние функции --------------------------------------------------------------------------
unsigned long DestinationSetXYZ (Destination pDst, float fLeft, float fTop, float fZoom)
{
unsigned long nRet = OK;
Page pTarget = NULL;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
// Если параметр приближения задан некорректно, тогда оставляем его нетронутым(что соответствует значению 0)
if ( fZoom < 0.08 || fZoom > 32 )
fZoom = 0;
if ( fLeft < 0 || fTop < 0 )
return RaiseError( pDst->oError, AVS_OFFICEPDFWRITER_ERROR_INVALID_PARAMETER, 0 );
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)XYZ ] );
nRet += ArrayAddReal( pDst, fLeft);
nRet += ArrayAddReal( pDst, fTop);
nRet += ArrayAddReal( pDst, fZoom);
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
unsigned long DestinationSetFit (Destination pDst)
{
unsigned long nRet = OK;
Page pTarget;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)Fit ] );
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
unsigned long DestinationSetFitH (Destination pDst, float fTop)
{
unsigned long nRet = OK;
Page pTarget;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)FitH ] );
nRet += ArrayAddReal( pDst, fTop );
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
unsigned long DestinationSetFitV (Destination pDst, float fLeft)
{
unsigned long nRet = OK;
Page pTarget;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)FitV ] );
nRet += ArrayAddReal( pDst, fLeft );
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
unsigned long DestinationSetFitR (Destination pDst, float fLeft, float fBottom, float fRight, float fTop)
{
unsigned long nRet = OK;
Page pTarget;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)FitR ] );
nRet += ArrayAddReal( pDst, fLeft);
nRet += ArrayAddReal( pDst, fBottom);
nRet += ArrayAddReal( pDst, fRight);
nRet += ArrayAddReal( pDst, fTop);
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
unsigned long DestinationSetFitB (Destination pDst)
{
unsigned long nRet = OK;
Page pTarget;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)FitB ] );
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
unsigned long DestinationSetFitBH (Destination pDst, float fTop)
{
unsigned long nRet = OK;
Page pTarget;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)FitBH ] );
nRet += ArrayAddReal( pDst, fTop );
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
unsigned long DestinationSetFitBV (Destination pDst, float fLeft)
{
unsigned long nRet = OK;
Page pTarget;
if ( !DestinationValidate( pDst ) )
return AVS_OFFICEPDFWRITER_ERROR_INVALID_DESTINATION;
pTarget = (Page)ArrayGetItem( pDst, 0, OCLASS_DICT );
if ( pDst->pList->nCount > 1 )
{
ArrayClear( pDst );
nRet += ArrayAdd( pDst, pTarget );
}
nRet += ArrayAddName( pDst, c_asDestinationType[ (int)FitBV ] );
nRet += ArrayAddReal( pDst, fLeft );
if ( OK != nRet )
return CheckError( pDst->oError );
return OK;
}
#ifndef _DESTINATION_H
#define _DESTINATION_H
#pragma once
#include "Objects.h"
//----- DestinationObject -----------------------------------------------------------------------
Destination DestinationNew (MMgr oMMgr, Page pTarget, Xref pXref);
BOOL DestinationValidate (Destination pDst);
//----- Внешние функции --------------------------------------------------------------------------
unsigned long DestinationSetXYZ (Destination pDst, float fLeft, float fTop, float fZoom);
unsigned long DestinationSetFit (Destination pDst);
unsigned long DestinationSetFitH (Destination pDst, float fTop);
unsigned long DestinationSetFitV (Destination pDst, float fLeft);
unsigned long DestinationSetFitR (Destination pDst, float fLeft, float fBottom, float fRight, float fTop);
unsigned long DestinationSetFitB (Destination pDst);
unsigned long DestinationSetFitBH (Destination pDst, float fTop);
unsigned long DestinationSetFitBV (Destination pDst, float fLeft);
#endif /* _DESTINATION_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _ENCRYPT_DICTIONARY_H
#define _ENCRYPT_DICTIONARY_H
#pragma once
#include "MetaData.h"
//-------- EncryptDict - ќсновные функции ------------------------------------------------
void EncryptDictOnFree (Dict pObj);
EncryptDict EncryptDictNew (MMgr oMMgr, Xref pXref);
void EncryptDictCreateID (EncryptDict pDict, Dict pInfo, Xref pXref);
unsigned long EncryptDictSetPassword(EncryptDict pDict, const char *sOwnerPassword, const char *sUserPassword);
BOOL EncryptDictValidate (EncryptDict pDict);
unsigned long EncryptDictPrepare (EncryptDict pDict, Dict pInfo, Xref pXref);
EncryptRecPtr EncryptDictGetAttr (EncryptDict pDict);
#endif /* _ENCRYPT_DICTIONARY_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _FONT_BASE_H
#define _FONT_BASE_H
#include "Utils.h"
#include "Font.h"
//----- BaseFontDef основные функции ----------------------------------------------------------------
FontDef BaseFontDefNew (MMgr oMMgr, const char *sFontName);
unsigned long BaseFontDefSetProps (FontDef pFontDef, short shAscent, short shDescent, unsigned int unFlags, Box oFontBox, short shItalicAngle, unsigned short ushStemV, short shAvgWidth, short shMaxWidth, short shMissingWidth, unsigned short ushStemH, unsigned short ushXHeight, unsigned short ushCapHeight);
FontDict BaseFontNew (MMgr oMMgr, FontDef pFontDef, EncoderRecPtr pEncoder, Xref pXref, PToUnicode pToUnicode);
#endif /* _FONT_BASE_H */
\ No newline at end of file
#ifndef _FONT_BASE_14_H
#define _FONT_BASE_14_H
#include "Utils.h"
#include "FontTypes.h"
#include "FontType1.h"
//----- ќсновные 14 фонтов --------------------------------------------------------------------------
#define FONT_COURIER "Courier"
#define FONT_COURIER_BOLD "Courier-Bold"
#define FONT_COURIER_OBLIQUE "Courier-Oblique"
#define FONT_COURIER_BOLD_OBLIQUE "Courier-BoldOblique"
#define FONT_HELVETICA "Helvetica"
#define FONT_HELVETICA_BOLD "Helvetica-Bold"
#define FONT_HELVETICA_OBLIQUE "Helvetica-Oblique"
#define FONT_HELVETICA_BOLD_OBLIQUE "Helvetica-BoldOblique"
#define FONT_TIMES_ROMAN "Times-Roman"
#define FONT_TIMES_BOLD "Times-Bold"
#define FONT_TIMES_ITALIC "Times-Italic"
#define FONT_TIMES_BOLD_ITALIC "Times-BoldItalic"
#define FONT_SYMBOL "Symbol"
#define FONT_ZAPF_DINGBATS "ZapfDingbats"
typedef struct TBase14FontDefData
{
const char *sFontName;//[LIMIT_MAX_NAME_LEN + 1];
const CharData *pWidthsTable;
BOOL bIsFontSpecific;
short nAscent;
short nDescent;
unsigned short nXHeight;
unsigned short nCapHeight;
Box oBox;
} Base14FontDefData;
//---------------------------------------------------------------------------------------------------
const Base14FontDefData* Base14FontDefFindBuiltinData(const char *sFontName);
FontDef Base14FontDefNew (MMgr oMMgr, const char *sFontName);
#endif /* _FONT_BASE_14_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _FONT_TYPE_1_H
#define _FONT_TYPE_1_H
#include "Utils.h"
#include "Font.h"
//----- Type1FontDef основные функции ---------------------------------------------------------------
FontDef Type1FontDefNew (MMgr oMMgr);
FontDef Type1FontDefLoad (MMgr oMMgr, StreamRecPtr pAFM, StreamRecPtr pFontData, short nType);
FontDef Type1FontDefDuplicate (MMgr oMMgr, FontDef pSrc);
unsigned long Type1FontDefSetWidths (FontDef pFontDef, const CharData* poWidths);
short Type1FontDefGetWidth (FontDef pFontDef, unsigned short nUnicode);
short Type1FontDefGetWidthByName (FontDef pFontDef, const char* sGlyphName);
FontDict Type1FontNew (MMgr oMMgr, FontDef pFontDef, EncoderRecPtr pEncoder, Xref pXref, PToUnicode pToUnicode);
#endif /* _FONT_TYPE_1_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// OnlineOfficeBinToPdf.cpp : Implementation of COnlineOfficeBinToPdf
#include "OnlineOfficeBinToPdf.h"
// COnlineOfficeBinToPdf
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
B// PDFWriter.h : Declaration of the CPDFWriter
This diff is collapsed.
// stdafx.cpp : source file that includes just the standard includes
// AVSOfficePDFWriter.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment