本文整理汇总了C++中Annotation::IsDeleted方法的典型用法代码示例。如果您正苦于以下问题:C++ Annotation::IsDeleted方法的具体用法?C++ Annotation::IsDeleted怎么用?C++ Annotation::IsDeleted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Annotation
的用法示例。
在下文中一共展示了Annotation::IsDeleted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAnnotArray
bool AnnotWriter::UpdateAnnotArray(int pageNo, Annotations* annots, Ref annotArray) {
ASSERT(annots->HasChanged());
Object array;
array.initArray(mXRef);
for (int i = 0; i < annots->Length(); i++) {
Annotation* a = annots->At(i);
if (!a->IsDeleted()) {
AddToAnnots(&array, a);
if (a->GetPopup()) AddToAnnots(&array, a->GetPopup());
}
}
// write to file
WriteObject(annotArray, &array);
array.free();
return true;
}
示例2: WriteTo
// Create new PDF file and append changed or new annotations
bool AnnotWriter::WriteTo(const char* name) {
if (!CopyFile(name)) return false;
if (!mAnnots.HasChanged()) return true;
AssignShortFontNames();
mFile = fopen(name, "a+b");
bool ok = mFile != NULL;
int numPages = mDoc->getNumPages();
for (int i = 0; ok && i < numPages; i ++) {
mPageRef = *mDoc->getCatalog()->getPageRef(i+1);
Annotations* a = mAnnots.Get(i);
if (a && a->HasChanged()) {
Ref annotArray;
ok = ok && UpdatePage(i, a, annotArray);
ok = ok && UpdateAnnotArray(i, a, annotArray);
for (int j = 0; ok && j < a->Length(); j ++) {
Annotation* an = a->At(j);
if (!an->IsDeleted()) {
if (CanWrite(an)) {
ok = UpdateAnnot(an);
}
} else {
if (!is_empty_ref(an->GetRef())) {
mXRefTable.DeleteRef(an->GetRef());
}
}
}
}
}
if (ok) {
UpdateInfoDict();
UpdateBePDFAcroForm();
UpdateCatalog();
ok = WriteXRefTable();
ok = ok && WriteFileTrailer();
}
if (mFile) {
fclose(mFile); mFile = NULL;
}
if (!ok) {
// delete file on error
unlink(name);
}
UnassignShortFontNames();
return ok;
}