| Commit-Queue | +1 |
Hey guys, decided to add a CL to add support for querying the names of and the visibility of OCGs. So far this only adds a few APIs which were requested by the initial CL, however more can be perhaps added in future in terms of write support perhaps. Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
ocg_names.push_back(ocg_dict->GetByteStringFor("Name"));do we want to push blank strings if there isn't this key?
FPDF_GetOCGCount(FPDF_DOCUMENT document) {nit: no line breaking before.
CPDF_Document* doc = CPDFDocumentFromFPDFDocument(document);this handles null, maybe convert first then check in case this someday does more checking besides straight cast?
return static_cast<uint32_t>(oc_context->GetOCGNames().size());uint32_t isn't always unsigned long.
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetOCGName(FPDF_DOCUMENT document,Check for null documents maybe rather than relying on downstrea.
// FPDF_LoadDocument(). name - The OCG name, encoded in UTF-8.formatting.
// document - Handle to the document. Returned by
// FPDF_LoadDocument(). index - Zero-based index of the OCG.
// Must be less than the
// value returned by FPDF_GetOCGCount().
// buffer - Buffer to receive the name, in UTF-16LE. Can be
// NULL if |buflen| is 0.
// buflen - Length of |buffer|, in bytes.
// Return value:watch formatting.
FPDF_GetOCGCount(FPDF_DOCUMENT document);again, line break.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
do we want to push blank strings if there isn't this key?
Nope we don't want to push back the strings in that case. Added the check.
FWIW: /Name is mandatory per spec so valid PDFs should be fine, but adding the check just in case.
null return on not found?
The variable used to take care of that as if nothing was found it would return nullptr because it was initialized to that on 215, but after directly returning at 223 the variable isn't needed. edited.
nit: no line breaking before.
This is 83 cols so CL format wraps it.
CPDF_Document* doc = CPDFDocumentFromFPDFDocument(document);this handles null, maybe convert first then check in case this someday does more checking besides straight cast?
Done
return static_cast<uint32_t>(oc_context->GetOCGNames().size());uint32_t isn't always unsigned long.
Done
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetOCGName(FPDF_DOCUMENT document,Check for null documents maybe rather than relying on downstrea.
Done
// FPDF_LoadDocument(). name - The OCG name, encoded in UTF-8.Aryan Krishnanformatting.
Done
// document - Handle to the document. Returned by
// FPDF_LoadDocument(). index - Zero-based index of the OCG.
// Must be less than the
// value returned by FPDF_GetOCGCount().
// buffer - Buffer to receive the name, in UTF-16LE. Can be
// NULL if |buflen| is 0.
// buflen - Length of |buffer|, in bytes.
// Return value:Aryan Krishnanwatch formatting.
Done
FPDF_GetOCGCount(FPDF_DOCUMENT document);Aryan Krishnanagain, line break.
This wraps to 83, hence CL format adds in the break.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |