mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 00:07:59 +02:00
Remove trailing whitespace (#3668)
This commit is contained in:
@@ -18,7 +18,7 @@ AttributedString::AttributedString():
|
||||
}
|
||||
|
||||
|
||||
AttributedString::AttributedString(const char* content):
|
||||
AttributedString::AttributedString(const char* content):
|
||||
_content(content),
|
||||
_align(ALIGN_LEFT),
|
||||
_style(STYLE_PLAIN),
|
||||
@@ -29,8 +29,8 @@ AttributedString::AttributedString(const char* content):
|
||||
|
||||
|
||||
AttributedString::AttributedString(const std::string& content, Alignment align, int style):
|
||||
_content(content),
|
||||
_align(align),
|
||||
_content(content),
|
||||
_align(align),
|
||||
_style(static_cast<Style>(style)),
|
||||
_fontName("Helvetica"),
|
||||
_fontSize(10)
|
||||
|
@@ -21,7 +21,7 @@ namespace PDF {
|
||||
|
||||
Destination::Destination(HPDF_Doc* pPDF,
|
||||
const HPDF_Destination& destination,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Destination>(pPDF, destination, name)
|
||||
{
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ namespace PDF {
|
||||
Document::Document(const std::string fileName,
|
||||
Poco::UInt32 pageCount,
|
||||
Page::Size pageSize,
|
||||
Page::Orientation orientation):
|
||||
Page::Orientation orientation):
|
||||
_pdf(HPDF_New(HPDF_Error_Handler, 0)),
|
||||
_fileName(fileName),
|
||||
_pRawData(0),
|
||||
@@ -42,7 +42,7 @@ Document::Document(const std::string fileName,
|
||||
|
||||
Document::Document(Poco::UInt32 pageCount,
|
||||
Page::Size pageSize,
|
||||
Page::Orientation orientation):
|
||||
Page::Orientation orientation):
|
||||
_pdf(HPDF_New(HPDF_Error_Handler, 0)),
|
||||
_pRawData(0),
|
||||
_size(0)
|
||||
@@ -142,7 +142,7 @@ const Page& Document::getCurrentPage()
|
||||
const Font& Document::loadFont(const std::string& name, const std::string& encoding)
|
||||
{
|
||||
Font font(&_pdf, HPDF_GetFont(_pdf, name.c_str(), encoding.empty() ? 0 : encoding.c_str()));
|
||||
std::pair<FontContainer::iterator, bool> ret =
|
||||
std::pair<FontContainer::iterator, bool> ret =
|
||||
_fonts.insert(FontContainer::value_type(name, font));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@@ -176,9 +176,9 @@ std::string Document::loadTTFont(const std::string& fileName, bool embed, int in
|
||||
}
|
||||
else if (index >= 0)
|
||||
{
|
||||
return HPDF_LoadTTFontFromFile2(_pdf,
|
||||
fileName.c_str(),
|
||||
static_cast<HPDF_UINT>(index),
|
||||
return HPDF_LoadTTFontFromFile2(_pdf,
|
||||
fileName.c_str(),
|
||||
static_cast<HPDF_UINT>(index),
|
||||
embed ? HPDF_TRUE : HPDF_FALSE);
|
||||
}
|
||||
else
|
||||
@@ -206,7 +206,7 @@ const Image& Document::loadPNGImageImpl(const std::string& fileName, bool doLoad
|
||||
if (it.second) return it.first->second;
|
||||
else throw IllegalStateException("Could not insert image.");
|
||||
}
|
||||
else
|
||||
else
|
||||
throw NotFoundException("File not found: " + fileName);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ const Image& Document::loadJPEGImage(const std::string& fileName)
|
||||
if (it.second) return it.first->second;
|
||||
else throw IllegalStateException("Could not insert image.");
|
||||
}
|
||||
else
|
||||
else
|
||||
throw NotFoundException("File not found: " + fileName);
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ const Encoder& Document::loadEncoder(const std::string& name)
|
||||
if (_encoders.end() == it) return it->second;
|
||||
|
||||
Encoder enc(&_pdf, HPDF_GetEncoder(_pdf, name.c_str()), name);
|
||||
std::pair<EncoderContainer::iterator, bool> ret =
|
||||
std::pair<EncoderContainer::iterator, bool> ret =
|
||||
_encoders.insert(EncoderContainer::value_type(name, enc));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@@ -266,7 +266,7 @@ const Encoder& Document::getCurrentEncoder()
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
}
|
||||
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ void Document::setInfo(Info info, const std::string& value)
|
||||
{
|
||||
if (INFO_CREATION_DATE == info || INFO_MOD_DATE == info)
|
||||
throw InvalidArgumentException("Can not set document date.");
|
||||
|
||||
|
||||
HPDF_SetInfoAttr(_pdf, static_cast<HPDF_InfoType>(info), value.c_str());
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ namespace PDF {
|
||||
|
||||
Encoder::Encoder(HPDF_Doc* pPDF,
|
||||
const HPDF_Encoder& encoder,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Encoder>(pPDF, encoder, name)
|
||||
{
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
Font::Font(HPDF_Doc* pPDF, HPDF_Font font):
|
||||
Font::Font(HPDF_Doc* pPDF, HPDF_Font font):
|
||||
Resource<HPDF_Font>(pPDF, font, HPDF_Font_GetFontName(font))
|
||||
{
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
Image::Image(HPDF_Doc* pPDF, const HPDF_Image& resource, const std::string& name):
|
||||
Image::Image(HPDF_Doc* pPDF, const HPDF_Image& resource, const std::string& name):
|
||||
Resource<HPDF_Image>(pPDF, resource, name)
|
||||
{
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ namespace PDF {
|
||||
|
||||
LinkAnnotation::LinkAnnotation(HPDF_Doc* pPDF,
|
||||
const HPDF_Annotation& annotation,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Annotation>(pPDF, annotation, name)
|
||||
{
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ namespace Poco {
|
||||
namespace PDF {
|
||||
|
||||
|
||||
Outline::Outline(HPDF_Doc* pPDF, const HPDF_Outline& outline, const std::string& name):
|
||||
Outline::Outline(HPDF_Doc* pPDF, const HPDF_Outline& outline, const std::string& name):
|
||||
Resource<HPDF_Outline>(pPDF, outline, name)
|
||||
{
|
||||
open();
|
||||
|
@@ -26,20 +26,20 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
{
|
||||
switch (error_no)
|
||||
{
|
||||
case HPDF_ARRAY_COUNT_ERR:
|
||||
case HPDF_ARRAY_COUNT_ERR:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_ARRAY_ITEM_NOT_FOUND:
|
||||
case HPDF_ARRAY_ITEM_NOT_FOUND:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_ARRAY_ITEM_UNEXPECTED_TYPE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_BINARY_LENGTH_ERR:
|
||||
throw InvalidArgumentException("The length of the data exceeds HPDF_LIMIT_MAX_STRING_LEN.");
|
||||
case HPDF_CANNOT_GET_PALLET:
|
||||
throw NotFoundException("Cannot get a pallet data from PNG image.");
|
||||
throw NotFoundException("Cannot get a pallet data from PNG image.");
|
||||
case HPDF_DICT_COUNT_ERR:
|
||||
throw InvalidArgumentException("The count of elements of a dictionary exceeds HPDF_LIMIT_MAX_DICT_ELEMENT");
|
||||
case HPDF_DICT_ITEM_NOT_FOUND:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_DICT_ITEM_UNEXPECTED_TYPE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_DICT_STREAM_LENGTH_NOT_FOUND:
|
||||
@@ -47,7 +47,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_DOC_ENCRYPTDICT_NOT_FOUND:
|
||||
throw NotFoundException("HPDF_SetPermission() OR HPDF_SetEncryptMode() was called before a password is set.");
|
||||
case HPDF_DOC_INVALID_OBJECT:
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_DUPLICATE_REGISTRATION:
|
||||
throw IllegalStateException("Tried to register a font that has been registered.");
|
||||
case HPDF_EXCEED_JWW_CODE_NUM_LIMIT:
|
||||
@@ -55,7 +55,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_ENCRYPT_INVALID_PASSWORD:
|
||||
throw IllegalStateException("Tried to set the owner password to NULL.");
|
||||
case HPDF_ERR_UNKNOWN_CLASS:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_EXCEED_GSTATE_LIMIT:
|
||||
throw IllegalStateException("The depth of the stack exceeded HPDF_LIMIT_MAX_GSTATE.");
|
||||
case HPDF_FAILD_TO_ALLOC_MEM:
|
||||
@@ -65,13 +65,13 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_FILE_OPEN_ERROR:
|
||||
throw IOException("Cannot open a file. (A detailed code is set.)");
|
||||
case HPDF_FONT_EXISTS:
|
||||
throw IllegalStateException("Tried to load a font that has been registered.");
|
||||
throw IllegalStateException("Tried to load a font that has been registered.");
|
||||
case HPDF_FONT_INVALID_WIDTHS_TABLE:
|
||||
throw IllegalStateException("The format of a font-file is invalid. Internal error. The consistency of the data was lost.");
|
||||
throw IllegalStateException("The format of a font-file is invalid. Internal error. The consistency of the data was lost.");
|
||||
case HPDF_INVALID_AFM_HEADER:
|
||||
throw IllegalStateException("Cannot recognize a header of an afm file.");
|
||||
case HPDF_INVALID_ANNOTATION:
|
||||
throw IllegalStateException("The specified annotation handle is invalid.");
|
||||
throw IllegalStateException("The specified annotation handle is invalid.");
|
||||
case HPDF_INVALID_BIT_PER_COMPONENT:
|
||||
throw IllegalStateException("Bit-per-component of a image which was set as mask-image is invalid.");
|
||||
case HPDF_INVALID_CHAR_MATRICS_DATA:
|
||||
@@ -79,11 +79,11 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_INVALID_COLOR_SPACE:
|
||||
switch (detail_no)
|
||||
{
|
||||
case 1:
|
||||
case 1:
|
||||
throw InvalidArgumentException("The color_space parameter of HPDF_LoadRawImage is invalid.");
|
||||
case 2:
|
||||
case 2:
|
||||
throw InvalidArgumentException("Color-space of a image which was set as mask-image is invalid.");
|
||||
case 3:
|
||||
case 3:
|
||||
throw InvalidArgumentException("The function which is invalid in the present color-space was invoked.");
|
||||
default:
|
||||
throw PDFException();
|
||||
@@ -109,7 +109,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_INVALID_FONTDEF_DATA:
|
||||
switch (detail_no)
|
||||
{
|
||||
case 1:
|
||||
case 1:
|
||||
throw InvalidArgumentException("An invalid font handle was set.");
|
||||
case 2:
|
||||
throw InvalidArgumentException("Unsupported font format.");
|
||||
@@ -131,7 +131,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
{
|
||||
case 1:
|
||||
throw IllegalStateException("An invalid object is set.");
|
||||
case 2:
|
||||
case 2:
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
default:
|
||||
throw PDFException();
|
||||
@@ -167,15 +167,15 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_INVALID_WX_DATA:
|
||||
throw IOException("Cannot read a width-data from an afm file.");
|
||||
case HPDF_ITEM_NOT_FOUND:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_LIBPNG_ERROR:
|
||||
throw IOException("An error has returned from PNGLIB while loading an image.");
|
||||
case HPDF_NAME_INVALID_VALUE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_NAME_OUT_OF_RANGE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_PAGES_MISSING_KIDS_ENTRY:
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
throw IllegalStateException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_PAGE_CANNOT_FIND_OBJECT:
|
||||
throw NotFoundException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_PAGE_CANNOT_GET_ROOT_PAGES:
|
||||
@@ -197,7 +197,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_PAGE_INVALID_ROTATE_VALUE:
|
||||
throw InvalidArgumentException("The specified value is not a multiple of 90.");
|
||||
case HPDF_PAGE_INVALID_SIZE:
|
||||
throw InvalidArgumentException("An invalid page-size was set.");
|
||||
throw InvalidArgumentException("An invalid page-size was set.");
|
||||
case HPDF_PAGE_INVALID_XOBJECT:
|
||||
throw InvalidArgumentException("An invalid image-handle was set.");
|
||||
case HPDF_PAGE_OUT_OF_RANGE:
|
||||
@@ -219,7 +219,7 @@ void HPDF_Error_Handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void* user_
|
||||
case HPDF_TTF_INVALID_FOMAT:
|
||||
throw InvalidArgumentException("Unsupported ttf format.");
|
||||
case HPDF_TTF_MISSING_TABLE:
|
||||
throw InvalidArgumentException("Unsupported ttf format. (cannot find a necessary table)");
|
||||
throw InvalidArgumentException("Unsupported ttf format. (cannot find a necessary table)");
|
||||
case HPDF_UNSUPPORTED_FONT_TYPE:
|
||||
throw InvalidArgumentException("Internal error. The consistency of the data was lost.");
|
||||
case HPDF_UNSUPPORTED_FUNC:
|
||||
|
@@ -141,11 +141,11 @@ void Page::setRotation(int angle)
|
||||
const Destination& Page::createDestination(const std::string& name)
|
||||
{
|
||||
DestinationContainer::iterator it = _destinations.find(name);
|
||||
if (_destinations.end() != it)
|
||||
if (_destinations.end() != it)
|
||||
throw InvalidArgumentException("Destination already exists.");
|
||||
|
||||
Destination dest(&_pDocument->handle(), HPDF_Page_CreateDestination(_page), name);
|
||||
std::pair<DestinationContainer::iterator, bool> ret =
|
||||
std::pair<DestinationContainer::iterator, bool> ret =
|
||||
_destinations.insert(DestinationContainer::value_type(name, dest));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@@ -154,20 +154,20 @@ const Destination& Page::createDestination(const std::string& name)
|
||||
}
|
||||
|
||||
|
||||
const TextAnnotation& Page::createTextAnnotation(const std::string& name,
|
||||
const TextAnnotation& Page::createTextAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const std::string& text,
|
||||
const Encoder& encoder)
|
||||
{
|
||||
TextAnnotationContainer::iterator it = _textAnnotations.find(name);
|
||||
if (_textAnnotations.end() != it)
|
||||
if (_textAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
TextAnnotation ann(&_pDocument->handle(),
|
||||
HPDF_Page_CreateTextAnnot(_page, rect, text.c_str(), encoder),
|
||||
name);
|
||||
|
||||
std::pair<TextAnnotationContainer::iterator, bool> ret =
|
||||
std::pair<TextAnnotationContainer::iterator, bool> ret =
|
||||
_textAnnotations.insert(TextAnnotationContainer::value_type(name, ann));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@@ -176,18 +176,18 @@ const TextAnnotation& Page::createTextAnnotation(const std::string& name,
|
||||
}
|
||||
|
||||
|
||||
const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
|
||||
const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const Destination& dest)
|
||||
{
|
||||
LinkAnnotationContainer::iterator it = _linkAnnotations.find(name);
|
||||
if (_linkAnnotations.end() != it)
|
||||
if (_linkAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
LinkAnnotation ann(&_pDocument->handle(),
|
||||
HPDF_Page_CreateLinkAnnot(_page, rect, dest),
|
||||
name);
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
_linkAnnotations.insert(LinkAnnotationContainer::value_type(name, ann));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
@@ -196,18 +196,18 @@ const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
|
||||
}
|
||||
|
||||
|
||||
const LinkAnnotation& Page::createURILinkAnnotation(const std::string& name,
|
||||
const LinkAnnotation& Page::createURILinkAnnotation(const std::string& name,
|
||||
const Rectangle& rect,
|
||||
const std::string& uri)
|
||||
{
|
||||
LinkAnnotationContainer::iterator it = _linkAnnotations.find(name);
|
||||
if (_linkAnnotations.end() != it)
|
||||
if (_linkAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
LinkAnnotation ann(&_pDocument->handle(),
|
||||
HPDF_Page_CreateURILinkAnnot(_page, rect, uri.c_str()),
|
||||
name);
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
std::pair<LinkAnnotationContainer::iterator, bool> ret =
|
||||
_linkAnnotations.insert(LinkAnnotationContainer::value_type(name, ann));
|
||||
|
||||
if (ret.second) return ret.first->second;
|
||||
|
@@ -22,7 +22,7 @@ namespace PDF {
|
||||
|
||||
TextAnnotation::TextAnnotation(HPDF_Doc* pPDF,
|
||||
const HPDF_Annotation& annotation,
|
||||
const std::string& name):
|
||||
const std::string& name):
|
||||
Resource<HPDF_Annotation>(pPDF, annotation, name)
|
||||
{
|
||||
open();
|
||||
|
@@ -457,7 +457,7 @@ public:
|
||||
AttributedString::Alignment align = AttributedString::ALIGN_LEFT;
|
||||
int style = AttributedString::STYLE_PLAIN;
|
||||
|
||||
|
||||
|
||||
std::string fontFamily = _styles.getString("font-family");
|
||||
float fontSize = _styles.getFloat("font-size");
|
||||
std::string textAlign = _styles.getString("text-align", "left");
|
||||
|
@@ -81,7 +81,7 @@ HPDF_3DC3DMeasure_New(HPDF_MMgr mmgr,
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetColor(HPDF_3DMeasure measure,
|
||||
HPDF_3DMeasure_SetColor(HPDF_3DMeasure measure,
|
||||
HPDF_RGBColor color)
|
||||
{
|
||||
HPDF_Array array;
|
||||
@@ -105,7 +105,7 @@ HPDF_3DMeasure_SetColor(HPDF_3DMeasure measure,
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetTextSize(HPDF_3DMeasure measure,
|
||||
HPDF_3DMeasure_SetTextSize(HPDF_3DMeasure measure,
|
||||
HPDF_REAL textsize)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
@@ -117,7 +117,7 @@ HPDF_3DMeasure_SetTextSize(HPDF_3DMeasure measure,
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DMeasure_SetName(HPDF_3DMeasure measure,
|
||||
HPDF_3DMeasure_SetName(HPDF_3DMeasure measure,
|
||||
const char* name)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
@@ -133,7 +133,7 @@ HPDF_3DMeasure_SetName(HPDF_3DMeasure measure,
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetTextBoxSize(HPDF_3DMeasure measure,
|
||||
HPDF_3DC3DMeasure_SetTextBoxSize(HPDF_3DMeasure measure,
|
||||
HPDF_INT32 x,
|
||||
HPDF_INT32 y)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ HPDF_3DC3DMeasure_SetTextBoxSize(HPDF_3DMeasure measure,
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetText(HPDF_3DMeasure measure,
|
||||
HPDF_3DC3DMeasure_SetText(HPDF_3DMeasure measure,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder)
|
||||
{
|
||||
@@ -172,7 +172,7 @@ HPDF_3DC3DMeasure_SetText(HPDF_3DMeasure measure,
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DC3DMeasure_SetProjectionAnotation(HPDF_3DMeasure measure,
|
||||
HPDF_3DC3DMeasure_SetProjectionAnotation(HPDF_3DMeasure measure,
|
||||
HPDF_Annotation projectionanotation)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
@@ -378,7 +378,7 @@ HPDF_3DAnnot_New (HPDF_MMgr mmgr,
|
||||
if (!annot) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
HPDF_Dict_Add(annot, "Contents", HPDF_String_New (mmgr, "3D Model", NULL));
|
||||
|
||||
action = HPDF_Dict_New (mmgr);
|
||||
@@ -533,7 +533,7 @@ HPDF_Annot_SetGrayColor (HPDF_Annotation annot, HPDF_REAL color)
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
@@ -550,7 +550,7 @@ HPDF_Annot_SetNoColor (HPDF_Annotation annot)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
ret = HPDF_Dict_Add (annot, "C", cArray);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ CheckSubType (HPDF_Annotation annot,
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_Annot_Set3DView ( HPDF_MMgr mmgr,
|
||||
HPDF_Annot_Set3DView ( HPDF_MMgr mmgr,
|
||||
HPDF_Annotation annot,
|
||||
HPDF_Annotation annot3d,
|
||||
HPDF_Dict view3d)
|
||||
@@ -796,11 +796,11 @@ HPDF_Annot_Set3DView ( HPDF_MMgr mmgr,
|
||||
HPDF_Proxy proxyView3d;
|
||||
HPDF_Dict exData = HPDF_Dict_New( mmgr);
|
||||
HPDF_STATUS retS = HPDF_OK;
|
||||
|
||||
|
||||
retS += HPDF_Dict_AddName( exData, "Type", "ExData");
|
||||
retS += HPDF_Dict_AddName( exData, "Subtype", "Markup3D");
|
||||
retS += HPDF_Dict_Add( exData, "3DA", annot3d);
|
||||
|
||||
|
||||
proxyView3d = HPDF_Proxy_New( mmgr, view3d);
|
||||
|
||||
retS += HPDF_Dict_Add( exData, "3DV", proxyView3d);
|
||||
@@ -833,7 +833,7 @@ HPDF_Annotation
|
||||
HPDF_StampAnnot_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref,
|
||||
HPDF_Rect rect,
|
||||
HPDF_StampAnnotName name,
|
||||
HPDF_StampAnnotName name,
|
||||
const char* text,
|
||||
HPDF_Encoder encoder)
|
||||
{
|
||||
@@ -847,7 +847,7 @@ HPDF_StampAnnot_New (HPDF_MMgr mmgr,
|
||||
|
||||
if (HPDF_Dict_AddName ( annot, "Name", HPDF_STAMP_ANNOT_NAME_NAMES[name]) != HPDF_OK)
|
||||
return NULL;
|
||||
|
||||
|
||||
s = HPDF_String_New (mmgr, text, encoder);
|
||||
if (!s)
|
||||
return NULL;
|
||||
@@ -891,7 +891,7 @@ HPDF_TextMarkupAnnot_SetQuadPoints ( HPDF_Annotation annot, HPDF_Point lb, HPDF_
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_TextMarkupAnnot_SetQuadPoints\n"));
|
||||
|
||||
|
||||
quadPoints = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !quadPoints)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
@@ -946,7 +946,7 @@ HPDF_MarkupAnnot_SetRectDiff (HPDF_Annotation annot, HPDF_Rect rect) /* RD ent
|
||||
HPDF_REAL tmp;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetRectDiff\n"));
|
||||
|
||||
|
||||
array = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !array)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
@@ -977,9 +977,9 @@ HPDF_FreeTextAnnot_SetDefaultStyle (HPDF_Annotation annot,
|
||||
{
|
||||
HPDF_String s;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
|
||||
HPDF_PTRACE((" HPDF_FreeTextAnnot_SetDefaultStyle\n"));
|
||||
|
||||
|
||||
s = HPDF_String_New ( annot->mmgr, style, NULL);
|
||||
if ( !s)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
@@ -996,7 +996,7 @@ HPDF_FreeTextAnnot_Set3PointCalloutLine ( HPDF_Annotation annot, HPDF_Point star
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_FreeTextAnnot_Set3PointCalloutLine\n"));
|
||||
|
||||
|
||||
clPoints = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !clPoints)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
@@ -1024,7 +1024,7 @@ HPDF_FreeTextAnnot_Set2PointCalloutLine ( HPDF_Annotation annot, HPDF_Point star
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_FreeTextAnnot_Set3PointCalloutLine\n"));
|
||||
|
||||
|
||||
clPoints = HPDF_Array_New ( annot->mmgr);
|
||||
if ( !clPoints)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
@@ -1050,15 +1050,15 @@ HPDF_MarkupAnnot_SetCloudEffect (HPDF_Annotation annot, HPDF_INT cloudIntensity
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_MarkupAnnot_SetCloudEffect\n"));
|
||||
|
||||
|
||||
borderEffect = HPDF_Dict_New ( annot->mmgr);
|
||||
if (!borderEffect)
|
||||
return HPDF_Error_GetCode ( annot->error);
|
||||
|
||||
|
||||
ret += HPDF_Dict_Add ( annot, "BE", borderEffect);
|
||||
ret += HPDF_Dict_AddName ( borderEffect, "S", "C");
|
||||
ret += HPDF_Dict_AddNumber ( borderEffect, "I", cloudIntensity);
|
||||
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return HPDF_Error_GetCode (annot->error);
|
||||
|
||||
@@ -1066,8 +1066,8 @@ HPDF_MarkupAnnot_SetCloudEffect (HPDF_Annotation annot, HPDF_INT cloudIntensity
|
||||
}
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_LineAnnot_SetPosition (HPDF_Annotation annot,
|
||||
HPDF_Point startPoint, HPDF_LineAnnotEndingStyle startStyle,
|
||||
HPDF_LineAnnot_SetPosition (HPDF_Annotation annot,
|
||||
HPDF_Point startPoint, HPDF_LineAnnotEndingStyle startStyle,
|
||||
HPDF_Point endPoint, HPDF_LineAnnotEndingStyle endStyle)
|
||||
{
|
||||
HPDF_Array lineEndPoints;
|
||||
@@ -1113,7 +1113,7 @@ HPDF_LineAnnot_SetLeader (HPDF_Annotation annot, HPDF_INT leaderLen, HPDF_INT le
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE((" HPDF_LineAnnot_SetLeader\n"));
|
||||
|
||||
|
||||
ret += HPDF_Dict_AddNumber ( annot, "LL", leaderLen);
|
||||
ret += HPDF_Dict_AddNumber ( annot, "LLE", leaderExtLen);
|
||||
ret += HPDF_Dict_AddNumber ( annot, "LLO", leaderOffsetLen);
|
||||
@@ -1130,7 +1130,7 @@ HPDF_LineAnnot_SetCaption (HPDF_Annotation annot, HPDF_BOOL showCaption, HPDF_Li
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_Array capOffset;
|
||||
HPDF_PTRACE((" HPDF_LineAnnot_SetCaption\n"));
|
||||
|
||||
|
||||
ret += HPDF_Dict_AddBoolean ( annot, "Cap", showCaption);
|
||||
ret += HPDF_Dict_AddName( annot, "CP", HPDF_LINE_ANNOT_CAP_POSITION_NAMES[(HPDF_INT)position]);
|
||||
|
||||
|
@@ -242,7 +242,7 @@ UTF8_Init (HPDF_Encoder encoder)
|
||||
HPDF_LIMIT_MAX_NAME_LEN);
|
||||
attr->suppliment = 0;
|
||||
attr->writing_mode = HPDF_WMODE_HORIZONTAL;
|
||||
|
||||
|
||||
/* Not sure about this
|
||||
attr->uid_offset = 0;
|
||||
attr->xuid[0] = 0;
|
||||
|
@@ -55,7 +55,7 @@ HPDF_3DAnnotExData_New(HPDF_MMgr mmgr,
|
||||
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS)
|
||||
HPDF_3DAnnotExData_Set3DMeasurement(HPDF_ExData exdata,
|
||||
HPDF_3DAnnotExData_Set3DMeasurement(HPDF_ExData exdata,
|
||||
HPDF_3DMeasure measure)
|
||||
{
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
@@ -39,7 +39,7 @@ static const char * const HPDF_BM_NAMES[] = {
|
||||
HPDF_BOOL
|
||||
HPDF_ExtGState_Validate (HPDF_ExtGState ext_gstate)
|
||||
{
|
||||
if (!ext_gstate || (ext_gstate->header.obj_class !=
|
||||
if (!ext_gstate || (ext_gstate->header.obj_class !=
|
||||
(HPDF_OSUBCLASS_EXT_GSTATE | HPDF_OCLASS_DICT) &&
|
||||
ext_gstate->header.obj_class !=
|
||||
(HPDF_OSUBCLASS_EXT_GSTATE_R | HPDF_OCLASS_DICT)))
|
||||
@@ -54,8 +54,8 @@ ExtGState_Check (HPDF_ExtGState ext_gstate)
|
||||
{
|
||||
if (!HPDF_ExtGState_Validate (ext_gstate))
|
||||
return HPDF_INVALID_OBJECT;
|
||||
|
||||
if (ext_gstate->header.obj_class ==
|
||||
|
||||
if (ext_gstate->header.obj_class ==
|
||||
(HPDF_OSUBCLASS_EXT_GSTATE_R | HPDF_OCLASS_DICT))
|
||||
return HPDF_RaiseError (ext_gstate->error, HPDF_EXT_GSTATE_READ_ONLY,
|
||||
0);
|
||||
@@ -65,7 +65,7 @@ ExtGState_Check (HPDF_ExtGState ext_gstate)
|
||||
|
||||
|
||||
HPDF_Dict
|
||||
HPDF_ExtGState_New (HPDF_MMgr mmgr,
|
||||
HPDF_ExtGState_New (HPDF_MMgr mmgr,
|
||||
HPDF_Xref xref)
|
||||
{
|
||||
HPDF_Dict obj = HPDF_Dict_New (mmgr);
|
||||
@@ -92,12 +92,12 @@ HPDF_ExtGState_SetAlphaStroke (HPDF_ExtGState ext_gstate,
|
||||
HPDF_REAL value)
|
||||
{
|
||||
HPDF_STATUS ret = ExtGState_Check (ext_gstate);
|
||||
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
|
||||
if (value < 0 || value > 1.0f)
|
||||
return HPDF_RaiseError (ext_gstate->error,
|
||||
return HPDF_RaiseError (ext_gstate->error,
|
||||
HPDF_EXT_GSTATE_OUT_OF_RANGE, 0);
|
||||
|
||||
return HPDF_Dict_AddReal (ext_gstate, "CA", value);
|
||||
@@ -109,12 +109,12 @@ HPDF_ExtGState_SetAlphaFill (HPDF_ExtGState ext_gstate,
|
||||
HPDF_REAL value)
|
||||
{
|
||||
HPDF_STATUS ret = ExtGState_Check (ext_gstate);
|
||||
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
if (value < 0 || value > 1.0f)
|
||||
return HPDF_RaiseError (ext_gstate->error,
|
||||
return HPDF_RaiseError (ext_gstate->error,
|
||||
HPDF_EXT_GSTATE_OUT_OF_RANGE, 0);
|
||||
|
||||
return HPDF_Dict_AddReal (ext_gstate, "ca", value);
|
||||
@@ -126,12 +126,12 @@ HPDF_ExtGState_SetBlendMode (HPDF_ExtGState ext_gstate,
|
||||
HPDF_BlendMode bmode)
|
||||
{
|
||||
HPDF_STATUS ret = ExtGState_Check (ext_gstate);
|
||||
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
if ((int)bmode < 0 || (int)bmode > (int)HPDF_BM_EOF)
|
||||
return HPDF_RaiseError (ext_gstate->error,
|
||||
return HPDF_RaiseError (ext_gstate->error,
|
||||
HPDF_EXT_GSTATE_OUT_OF_RANGE, 0);
|
||||
|
||||
return HPDF_Dict_AddName (ext_gstate, "BM", HPDF_BM_NAMES[(int)bmode]);
|
||||
@@ -143,7 +143,7 @@ HPDF_ExtGState_SetStrokeAdjustment (HPDF_ExtGState ext_gstate,
|
||||
HPDF_BOOL value)
|
||||
{
|
||||
HPDF_STATUS ret = ExtGState_Check (ext_gstate);
|
||||
|
||||
|
||||
if (ret != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
|
@@ -99,7 +99,7 @@ struct _HPDF_CCITT_Data {
|
||||
tsize_t tif_rawdatasize;/* # of bytes in raw data buffer */
|
||||
tsize_t tif_rawcc; /* bytes unread from raw buffer */
|
||||
tidata_t tif_rawcp; /* current spot in raw buffer */
|
||||
tidata_t tif_rawdata; /* raw data buffer */
|
||||
tidata_t tif_rawdata; /* raw data buffer */
|
||||
|
||||
} HPDF_CCITT_Data;
|
||||
|
||||
@@ -124,7 +124,7 @@ static HPDF_STATUS HPDF_InitCCITTFax3(struct _HPDF_CCITT_Data *pData)
|
||||
/*
|
||||
* Override parent get/set field methods.
|
||||
*/
|
||||
sp->groupoptions = 0;
|
||||
sp->groupoptions = 0;
|
||||
sp->recvparams = 0;
|
||||
sp->subaddress = NULL;
|
||||
sp->faxdcs = NULL;
|
||||
@@ -209,7 +209,7 @@ HPDF_Fax3SetupState(struct _HPDF_CCITT_Data *pData, HPDF_UINT width,
|
||||
/*
|
||||
* Reset encoding state at the start of a strip.
|
||||
*/
|
||||
static HPDF_STATUS
|
||||
static HPDF_STATUS
|
||||
HPDF_Fax3PreEncode(struct _HPDF_CCITT_Data *pData/*, tsample_t s*/)
|
||||
{
|
||||
HPDF_Fax3CodecState* sp = EncoderState(pData);
|
||||
@@ -230,8 +230,8 @@ HPDF_Fax3PreEncode(struct _HPDF_CCITT_Data *pData/*, tsample_t s*/)
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
static HPDF_STATUS
|
||||
HPDF_CCITT_AppendToStream(HPDF_Stream dst,
|
||||
static HPDF_STATUS
|
||||
HPDF_CCITT_AppendToStream(HPDF_Stream dst,
|
||||
tidata_t tif_rawdata,
|
||||
tsize_t tif_rawcc)
|
||||
{
|
||||
@@ -245,7 +245,7 @@ HPDF_CCITT_AppendToStream(HPDF_Stream dst,
|
||||
* called by ``encodestrip routines'' w/o concern
|
||||
* for infinite recursion.
|
||||
*/
|
||||
static HPDF_STATUS
|
||||
static HPDF_STATUS
|
||||
HPDF_CCITT_FlushData(struct _HPDF_CCITT_Data *pData)
|
||||
{
|
||||
if (pData->tif_rawcc > 0) {
|
||||
@@ -533,7 +533,7 @@ find1span(unsigned char* bp, int32 bs, int32 be)
|
||||
|
||||
|
||||
/*
|
||||
void
|
||||
void
|
||||
HPDF_Fax3PostEncode(struct _HPDF_CCITT_Data *pData)
|
||||
{
|
||||
HPDF_Fax3CodecState* sp = EncoderState(pData);
|
||||
@@ -561,7 +561,7 @@ static const tableentry vcodes[7] = {
|
||||
* 2d-encode a row of pixels. Consult the CCITT
|
||||
* documentation for the algorithm.
|
||||
*/
|
||||
static HPDF_STATUS
|
||||
static HPDF_STATUS
|
||||
HPDF_Fax3Encode2DRow(struct _HPDF_CCITT_Data *pData, unsigned char* bp, unsigned char* rp, uint32 bits)
|
||||
{
|
||||
#define PIXEL(buf,ix) ((((buf)[(ix)>>3]) >> (7-((ix)&7))) & 1)
|
||||
@@ -606,7 +606,7 @@ HPDF_Fax3Encode2DRow(struct _HPDF_CCITT_Data *pData, unsigned char* bp, unsigned
|
||||
/*
|
||||
* Encode the requested amount of data.
|
||||
*/
|
||||
static HPDF_STATUS
|
||||
static HPDF_STATUS
|
||||
HPDF_Fax4Encode(struct _HPDF_CCITT_Data *pData, tidata_t bp, tsize_t cc/*, tsample_t s*/)
|
||||
{
|
||||
HPDF_Fax3CodecState *sp = EncoderState(pData);
|
||||
@@ -631,14 +631,14 @@ HPDF_Fax4PostEncode(struct _HPDF_CCITT_Data *pData)
|
||||
HPDF_Fax3PutBits(pData, EOL, 12);
|
||||
HPDF_Fax3PutBits(pData, EOL, 12);
|
||||
/*if (sp->bit != 8)
|
||||
HPDF_Fax3FlushBits(pData, sp);
|
||||
HPDF_Fax3FlushBits(pData, sp);
|
||||
*/
|
||||
HPDF_CCITT_FlushData(pData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
HPDF_STATUS
|
||||
HPDF_STATUS
|
||||
HPDF_Stream_CcittToStream( const HPDF_BYTE *buf,
|
||||
HPDF_Stream dst,
|
||||
HPDF_Encrypt e,
|
||||
@@ -663,7 +663,7 @@ HPDF_Stream_CcittToStream( const HPDF_BYTE *buf,
|
||||
pBufPos = buf+(line_width*(height-1));
|
||||
pBufEnd= buf-line_width;
|
||||
lineIncrement = -((int)line_width);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&data, 0, sizeof(struct _HPDF_CCITT_Data));
|
||||
data.dst = dst;
|
||||
@@ -750,7 +750,7 @@ HPDF_Image_Load1BitImageFromMem (HPDF_MMgr mmgr,
|
||||
/*
|
||||
* Load image from buffer
|
||||
* line_width - width of the line in bytes
|
||||
* top_is_first - image orientation:
|
||||
* top_is_first - image orientation:
|
||||
* TRUE if image is oriented TOP-BOTTOM;
|
||||
* FALSE if image is oriented BOTTOM-TOP
|
||||
*/
|
||||
@@ -783,7 +783,7 @@ HPDF_Image_LoadRaw1BitImageFromMem (HPDF_Doc pdf,
|
||||
if(image->filterParams==NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* pure 2D encoding, default is 0 */
|
||||
HPDF_Dict_AddNumber (image->filterParams, "K", -1);
|
||||
/* default is 1728 */
|
||||
|
@@ -474,7 +474,7 @@ LoadPngData (HPDF_Dict image,
|
||||
HPDF_Dict smask;
|
||||
png_bytep smask_data;
|
||||
|
||||
if (!png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ||
|
||||
if (!png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ||
|
||||
!png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL)) {
|
||||
goto no_transparent_color_in_palette;
|
||||
}
|
||||
@@ -534,7 +534,7 @@ LoadPngData (HPDF_Dict image,
|
||||
|
||||
no_transparent_color_in_palette:
|
||||
|
||||
/* read images with alpha channel right away
|
||||
/* read images with alpha channel right away
|
||||
we have to do this because image transparent mask must be added to the Xref */
|
||||
if (xref && PNG_COLOR_MASK_ALPHA & color_type) {
|
||||
HPDF_Dict smask;
|
||||
|
@@ -2830,7 +2830,7 @@ HPDF_Page_New_Content_Stream (HPDF_Page page,
|
||||
|
||||
/* check if there is already an array of contents */
|
||||
contents_array = (HPDF_Array) HPDF_Dict_GetItem(page,"Contents", HPDF_OCLASS_ARRAY);
|
||||
if (!contents_array) {
|
||||
if (!contents_array) {
|
||||
HPDF_Error_Reset (page->error);
|
||||
/* no contents_array already -- create one
|
||||
and replace current single contents item */
|
||||
@@ -2851,7 +2851,7 @@ HPDF_Page_New_Content_Stream (HPDF_Page page,
|
||||
|
||||
ret += HPDF_Array_Add (contents_array,attr->contents);
|
||||
|
||||
/* return the value of the new stream, so that
|
||||
/* return the value of the new stream, so that
|
||||
the application can use it as a shared contents stream */
|
||||
if (ret == HPDF_OK && new_stream != NULL)
|
||||
*new_stream = attr->contents;
|
||||
@@ -2879,7 +2879,7 @@ HPDF_Page_Insert_Shared_Content_Stream (HPDF_Page page,
|
||||
|
||||
/* check if there is already an array of contents */
|
||||
contents_array = (HPDF_Array) HPDF_Dict_GetItem(page,"Contents", HPDF_OCLASS_ARRAY);
|
||||
if (!contents_array) {
|
||||
if (!contents_array) {
|
||||
HPDF_PageAttr attr;
|
||||
HPDF_Error_Reset (page->error);
|
||||
/* no contents_array already -- create one
|
||||
|
@@ -695,7 +695,7 @@ AddAnnotation (HPDF_Page page,
|
||||
if (ret != HPDF_OK)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if ((ret = HPDF_Array_Add (array, annot)) != HPDF_OK)
|
||||
return ret;
|
||||
|
||||
@@ -1225,7 +1225,7 @@ HPDF_Page_GetCurrentTextPos (HPDF_Page page)
|
||||
if (attr->gmode & HPDF_GMODE_TEXT_OBJECT)
|
||||
pos = attr->text_pos;
|
||||
}
|
||||
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
@@ -1893,7 +1893,7 @@ HPDF_Page_Create3DC3DMeasure(HPDF_Page page,
|
||||
attr = (HPDF_PageAttr)page->attr;
|
||||
|
||||
measure = HPDF_3DC3DMeasure_New(page->mmgr, attr->xref, firstanchorpoint, textanchorpoint);
|
||||
if ( !measure)
|
||||
if ( !measure)
|
||||
HPDF_CheckError (page->error);
|
||||
|
||||
return measure;
|
||||
@@ -1921,9 +1921,9 @@ HPDF_Page_CreatePD33DMeasure(HPDF_Page page,
|
||||
|
||||
attr = (HPDF_PageAttr)page->attr;
|
||||
|
||||
measure = HPDF_PD33DMeasure_New(page->mmgr,
|
||||
attr->xref,
|
||||
annotationPlaneNormal,
|
||||
measure = HPDF_PD33DMeasure_New(page->mmgr,
|
||||
attr->xref,
|
||||
annotationPlaneNormal,
|
||||
firstAnchorPoint,
|
||||
secondAnchorPoint,
|
||||
leaderLinesDirection,
|
||||
@@ -1932,7 +1932,7 @@ HPDF_Page_CreatePD33DMeasure(HPDF_Page page,
|
||||
value,
|
||||
unitsString
|
||||
);
|
||||
if ( !measure)
|
||||
if ( !measure)
|
||||
HPDF_CheckError (page->error);
|
||||
|
||||
return measure;
|
||||
@@ -1953,7 +1953,7 @@ HPDF_Page_Create3DAnnotExData(HPDF_Page page)
|
||||
attr = (HPDF_PageAttr)page->attr;
|
||||
|
||||
exData = HPDF_3DAnnotExData_New(page->mmgr, attr->xref);
|
||||
if ( !exData)
|
||||
if ( !exData)
|
||||
HPDF_CheckError (page->error);
|
||||
|
||||
return exData;
|
||||
|
@@ -283,7 +283,7 @@ HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf,HPDF_PDFAType pdfatype)
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
/* Generate an ID for the trailer dict, PDF/A needs this.
|
||||
/* Generate an ID for the trailer dict, PDF/A needs this.
|
||||
TODO: Better algorithm for generate unique ID.
|
||||
*/
|
||||
HPDF_STATUS
|
||||
@@ -293,32 +293,32 @@ HPDF_PDFA_GenerateID(HPDF_Doc pdf)
|
||||
HPDF_BYTE *currentTime;
|
||||
HPDF_BYTE idkey[HPDF_MD5_KEY_LEN];
|
||||
HPDF_MD5_CTX md5_ctx;
|
||||
time_t ltime;
|
||||
time_t ltime;
|
||||
|
||||
ltime = time(NULL);
|
||||
ltime = time(NULL);
|
||||
currentTime = (HPDF_BYTE *)ctime(<ime);
|
||||
|
||||
|
||||
id = HPDF_Dict_GetItem(pdf->trailer, "ID", HPDF_OCLASS_ARRAY);
|
||||
if (!id) {
|
||||
id = HPDF_Array_New(pdf->mmgr);
|
||||
|
||||
if (!id || HPDF_Dict_Add(pdf->trailer, "ID", id) != HPDF_OK)
|
||||
return pdf->error.error_no;
|
||||
|
||||
|
||||
HPDF_MD5Init(&md5_ctx);
|
||||
HPDF_MD5Update(&md5_ctx, (HPDF_BYTE *) "libHaru", sizeof("libHaru") - 1);
|
||||
HPDF_MD5Update(&md5_ctx, currentTime, HPDF_StrLen((const char *)currentTime, -1));
|
||||
HPDF_MD5Final(idkey, &md5_ctx);
|
||||
|
||||
|
||||
if (HPDF_Array_Add (id, HPDF_Binary_New (pdf->mmgr, idkey, HPDF_MD5_KEY_LEN)) != HPDF_OK)
|
||||
return pdf->error.error_no;
|
||||
|
||||
if (HPDF_Array_Add (id, HPDF_Binary_New (pdf->mmgr,idkey,HPDF_MD5_KEY_LEN)) != HPDF_OK)
|
||||
return pdf->error.error_no;
|
||||
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
|
||||
return HPDF_OK;
|
||||
}
|
||||
|
||||
|
@@ -432,9 +432,9 @@ HPDF_Stream_WriteEscapeText2 (HPDF_Stream stream,
|
||||
|
||||
HPDF_PTRACE((" HPDF_Stream_WriteEscapeText2\n"));
|
||||
|
||||
/* The following block is commented out because it violates "PDF Spec 7.3.4.2 Literal Strings".
|
||||
* It states that the two matching parentheses must still be present to represent an empty
|
||||
* string of zero length.
|
||||
/* The following block is commented out because it violates "PDF Spec 7.3.4.2 Literal Strings".
|
||||
* It states that the two matching parentheses must still be present to represent an empty
|
||||
* string of zero length.
|
||||
*/
|
||||
/*
|
||||
if (!len)
|
||||
|
@@ -246,7 +246,7 @@ HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView(HPDF_MMgr mmgr, const char *name)
|
||||
|
||||
HPDF_PTRACE ((" HPDF_Create3DView\n"));
|
||||
|
||||
if (name == NULL || name[0] == '\0') {
|
||||
if (name == NULL || name[0] == '\0') {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView(HPDF_MMgr mmgr, const char *name)
|
||||
HPDF_Dict_Free (view);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
ret = HPDF_Dict_Add (view, "XN", HPDF_String_New (mmgr, name, NULL));
|
||||
if (ret != HPDF_OK) {
|
||||
HPDF_Dict_Free (view);
|
||||
@@ -344,7 +344,7 @@ HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_SetDefault3DView(HPDF_U3D u3d, const char *nam
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_AddNode(HPDF_Dict view, const char *name, HPDF_REAL opacity, HPDF_BOOL visible)
|
||||
{
|
||||
HPDF_Array nodes = NULL;
|
||||
HPDF_Dict node;
|
||||
HPDF_Dict node;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_3DView_AddNode\n"));
|
||||
@@ -461,7 +461,7 @@ HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetLighting(HPDF_Dict view, const char *sch
|
||||
|
||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetBackgroundColor(HPDF_Dict view, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b)
|
||||
{
|
||||
HPDF_Array color;
|
||||
HPDF_Array color;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
HPDF_Dict background;
|
||||
|
||||
@@ -630,7 +630,7 @@ HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, H
|
||||
HPDF_REAL upx, upy, upz;
|
||||
HPDF_REAL transx, transy, transz;
|
||||
|
||||
HPDF_Array matrix;
|
||||
HPDF_Array matrix;
|
||||
HPDF_STATUS ret = HPDF_OK;
|
||||
|
||||
HPDF_PTRACE ((" HPDF_3DView_SetCamera\n"));
|
||||
@@ -643,7 +643,7 @@ HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, H
|
||||
viewx = -c2cx;
|
||||
viewy = -c2cy;
|
||||
viewz = -c2cz;
|
||||
|
||||
|
||||
/* c2c = (0, -1, 0) by default */
|
||||
if (viewx == 0.0 && viewy == 0.0 && viewz == 0.0) {
|
||||
viewy = 1.0;
|
||||
@@ -671,7 +671,7 @@ HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, H
|
||||
upy =-1.0f;
|
||||
upz = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
if ( fabs(viewx) + fabs(viewy) != 0.0f) /* other views than top and bottom*/
|
||||
{
|
||||
/* up-vector = up_world - (up_world dot view) view*/
|
||||
@@ -708,7 +708,7 @@ HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, H
|
||||
upy = upyprime;
|
||||
upz = upzprime;
|
||||
}
|
||||
|
||||
|
||||
/* translation vector*/
|
||||
roo = (HPDF_REAL)fabs(roo);
|
||||
if (roo == 0.0) {
|
||||
@@ -783,7 +783,7 @@ HPDF_Dict HPDF_3DView_New( HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_U3D u3d, const
|
||||
|
||||
HPDF_PTRACE ((" HPDF_3DView_New\n"));
|
||||
|
||||
if (name == NULL || name[0] == '\0') {
|
||||
if (name == NULL || name[0] == '\0') {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -800,7 +800,7 @@ HPDF_Dict HPDF_3DView_New( HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_U3D u3d, const
|
||||
HPDF_Dict_Free (view);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
ret = HPDF_Dict_Add (view, "XN", HPDF_String_New (mmgr, name, NULL));
|
||||
if (ret != HPDF_OK) {
|
||||
HPDF_Dict_Free (view);
|
||||
|
@@ -896,6 +896,6 @@ png_get_user_height_max (png_structp png_ptr)
|
||||
return (png_ptr? png_ptr->user_height_max : 0);
|
||||
}
|
||||
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
|
||||
|
||||
|
||||
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
@@ -1491,7 +1491,7 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
}
|
||||
#endif
|
||||
png_memcpy((png_charp)png_ptr->unknown_chunk.name,
|
||||
(png_charp)png_ptr->chunk_name,
|
||||
(png_charp)png_ptr->chunk_name,
|
||||
png_sizeof(png_ptr->unknown_chunk.name));
|
||||
png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1]='\0';
|
||||
|
||||
|
@@ -1319,7 +1319,7 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
if(rgb_error)
|
||||
{
|
||||
png_ptr->rgb_to_gray_status=1;
|
||||
if((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
if((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
PNG_RGB_TO_GRAY_WARN)
|
||||
png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
||||
if((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
@@ -3824,7 +3824,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
||||
dp = row + (row_info->rowbytes << 1) - 1;
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if (*(sp-1) == gray_high && *(sp) == gray_low)
|
||||
if (*(sp-1) == gray_high && *(sp) == gray_low)
|
||||
{
|
||||
*dp-- = 0;
|
||||
*dp-- = 0;
|
||||
|
@@ -2224,7 +2224,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
#endif
|
||||
png_memcpy((png_charp)png_ptr->unknown_chunk.name,
|
||||
(png_charp)png_ptr->chunk_name,
|
||||
(png_charp)png_ptr->chunk_name,
|
||||
png_sizeof(png_ptr->unknown_chunk.name));
|
||||
png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1] = '\0';
|
||||
png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length);
|
||||
|
@@ -1040,8 +1040,8 @@ png_set_unknown_chunks(png_structp png_ptr,
|
||||
png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i;
|
||||
png_unknown_chunkp from = unknowns + i;
|
||||
|
||||
png_memcpy((png_charp)to->name,
|
||||
(png_charp)from->name,
|
||||
png_memcpy((png_charp)to->name,
|
||||
(png_charp)from->name,
|
||||
png_sizeof(from->name));
|
||||
to->name[png_sizeof(to->name)-1] = '\0';
|
||||
|
||||
|
@@ -1007,7 +1007,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
pointed to by png_convert_to_rfc1123() gets free'ed before
|
||||
we use it */
|
||||
png_memcpy(tIME_string,
|
||||
png_convert_to_rfc1123(read_ptr, mod_time),
|
||||
png_convert_to_rfc1123(read_ptr, mod_time),
|
||||
png_sizeof(tIME_string));
|
||||
tIME_string[png_sizeof(tIME_string)-1] = '\0';
|
||||
tIME_chunk_present++;
|
||||
|
16
PDF/src/t4.h
16
PDF/src/t4.h
@@ -4,23 +4,23 @@
|
||||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
Reference in New Issue
Block a user