blob: 9234f44ac105d8072c075536d896477ec4922be0 [file] [log] [blame]
halcanary34422612015-10-12 10:11:18 -07001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Hal Canaryc640d0d2018-06-13 09:59:02 -04008#include "SkPDFMetadata.h"
9
halcanary488165e2016-04-22 06:10:21 -070010#include "SkMD5.h"
halcanaryffe54002016-03-29 09:09:29 -070011#include "SkMilestone.h"
halcanary34422612015-10-12 10:11:18 -070012#include "SkPDFTypes.h"
Hal Canaryc640d0d2018-06-13 09:59:02 -040013#include "SkTo.h"
Hal Canaryd6e6e662017-06-17 10:38:13 -040014#include "SkUtils.h"
15
bungeman221524d2016-01-05 14:59:40 -080016#include <utility>
halcanary34422612015-10-12 10:11:18 -070017
halcanary9f4b3322016-06-30 08:22:04 -070018#define SKPDF_STRING(X) SKPDF_STRING_IMPL(X)
19#define SKPDF_STRING_IMPL(X) #X
20#define SKPDF_PRODUCER "Skia/PDF m" SKPDF_STRING(SK_MILESTONE)
21#define SKPDF_CUSTOM_PRODUCER_KEY "ProductionLibrary"
22
halcanary34422612015-10-12 10:11:18 -070023static SkString pdf_date(const SkTime::DateTime& dt) {
24 int timeZoneMinutes = SkToInt(dt.fTimeZoneMinutes);
25 char timezoneSign = timeZoneMinutes >= 0 ? '+' : '-';
26 int timeZoneHours = SkTAbs(timeZoneMinutes) / 60;
27 timeZoneMinutes = SkTAbs(timeZoneMinutes) % 60;
28 return SkStringPrintf(
29 "D:%04u%02u%02u%02u%02u%02u%c%02d'%02d'",
30 static_cast<unsigned>(dt.fYear), static_cast<unsigned>(dt.fMonth),
31 static_cast<unsigned>(dt.fDay), static_cast<unsigned>(dt.fHour),
32 static_cast<unsigned>(dt.fMinute),
33 static_cast<unsigned>(dt.fSecond), timezoneSign, timeZoneHours,
34 timeZoneMinutes);
35}
36
Hal Canary691fd1b2018-02-28 14:10:42 -050037static bool utf8_is_pdfdocencoding(const char* src, size_t len) {
38 const uint8_t* end = (const uint8_t*)src + len;
39 for (const uint8_t* ptr = (const uint8_t*)src; ptr < end; ++ptr) {
40 uint8_t v = *ptr;
41 // See Table D.2 (PDFDocEncoding Character Set) in the PDF3200_2008 spec.
42 if ((v > 23 && v < 32) || v > 126) {
43 return false;
44 }
45 }
46 return true;
47}
48
49void write_utf16be(char** ptr, uint16_t value) {
50 *(*ptr)++ = (value >> 8);
51 *(*ptr)++ = (value & 0xFF);
52}
53
54// Please Note: This "abuses" the SkString, which "should" only hold UTF8.
55// But the SkString is written as if it is really just a ref-counted array of
56// chars, so this works, as long as we handle endiness and conversions ourselves.
57//
58// Input: UTF-8
59// Output UTF-16-BE
60static SkString to_utf16be(const char* src, size_t len) {
61 SkString ret;
62 const char* const end = src + len;
63 size_t n = 1; // BOM
64 for (const char* ptr = src; ptr < end;) {
65 SkUnichar u = SkUTF8_NextUnicharWithError(&ptr, end);
66 if (u < 0) {
67 break;
68 }
69 n += SkUTF16_FromUnichar(u);
70 }
71 ret.resize(2 * n);
72 char* out = ret.writable_str();
73 write_utf16be(&out, 0xFEFF); // BOM
74 for (const char* ptr = src; ptr < end;) {
75 SkUnichar u = SkUTF8_NextUnicharWithError(&ptr, end);
76 if (u < 0) {
77 break;
78 }
79 uint16_t utf16[2];
80 size_t l = SkUTF16_FromUnichar(u, utf16);
81 write_utf16be(&out, utf16[0]);
82 if (l == 2) {
83 write_utf16be(&out, utf16[1]);
84 }
85 }
86 SkASSERT(out == ret.writable_str() + 2 * n);
87 return ret;
88}
89
90// Input: UTF-8
91// Output UTF-16-BE OR PDFDocEncoding (if that encoding is identical to ASCII encoding).
92//
93// See sections 14.3.3 (Document Information Dictionary) and 7.9.2.2 (Text String Type)
94// of the PDF32000_2008 spec.
95static SkString convert(const SkString& s) {
96 return utf8_is_pdfdocencoding(s.c_str(), s.size()) ? s : to_utf16be(s.c_str(), s.size());
97}
98static SkString convert(const char* src) {
99 size_t len = strlen(src);
100 return utf8_is_pdfdocencoding(src, len) ? SkString(src, len) : to_utf16be(src, len);
101}
102
halcanary4b656662016-04-27 07:45:18 -0700103namespace {
104static const struct {
105 const char* const key;
106 SkString SkDocument::PDFMetadata::*const valuePtr;
107} gMetadataKeys[] = {
108 {"Title", &SkDocument::PDFMetadata::fTitle},
109 {"Author", &SkDocument::PDFMetadata::fAuthor},
110 {"Subject", &SkDocument::PDFMetadata::fSubject},
111 {"Keywords", &SkDocument::PDFMetadata::fKeywords},
112 {"Creator", &SkDocument::PDFMetadata::fCreator},
113};
114} // namespace
115
halcanary4b656662016-04-27 07:45:18 -0700116sk_sp<SkPDFObject> SkPDFMetadata::MakeDocumentInformationDict(
117 const SkDocument::PDFMetadata& metadata) {
halcanaryece83922016-03-08 08:32:12 -0800118 auto dict = sk_make_sp<SkPDFDict>();
halcanary4b656662016-04-27 07:45:18 -0700119 for (const auto keyValuePtr : gMetadataKeys) {
120 const SkString& value = metadata.*(keyValuePtr.valuePtr);
121 if (value.size() > 0) {
Hal Canary691fd1b2018-02-28 14:10:42 -0500122 dict->insertString(keyValuePtr.key, convert(value));
halcanary34422612015-10-12 10:11:18 -0700123 }
124 }
halcanary9f4b3322016-06-30 08:22:04 -0700125 if (metadata.fProducer.isEmpty()) {
Hal Canary691fd1b2018-02-28 14:10:42 -0500126 dict->insertString("Producer", convert(SKPDF_PRODUCER));
halcanary9f4b3322016-06-30 08:22:04 -0700127 } else {
Hal Canary691fd1b2018-02-28 14:10:42 -0500128 dict->insertString("Producer", convert(metadata.fProducer));
129 dict->insertString(SKPDF_CUSTOM_PRODUCER_KEY, convert(SKPDF_PRODUCER));
halcanary9f4b3322016-06-30 08:22:04 -0700130 }
halcanary4b656662016-04-27 07:45:18 -0700131 if (metadata.fCreation.fEnabled) {
Hal Canary691fd1b2018-02-28 14:10:42 -0500132 dict->insertString("CreationDate", pdf_date(metadata.fCreation.fDateTime));
halcanary34422612015-10-12 10:11:18 -0700133 }
halcanary4b656662016-04-27 07:45:18 -0700134 if (metadata.fModified.fEnabled) {
135 dict->insertString("ModDate", pdf_date(metadata.fModified.fDateTime));
halcanary34422612015-10-12 10:11:18 -0700136 }
Kevin Lubickf7621cb2018-04-16 15:51:44 -0400137 return std::move(dict);
halcanary34422612015-10-12 10:11:18 -0700138}
139
halcanary4b656662016-04-27 07:45:18 -0700140SkPDFMetadata::UUID SkPDFMetadata::CreateUUID(
141 const SkDocument::PDFMetadata& metadata) {
halcanary34422612015-10-12 10:11:18 -0700142 // The main requirement is for the UUID to be unique; the exact
143 // format of the data that will be hashed is not important.
144 SkMD5 md5;
145 const char uuidNamespace[] = "org.skia.pdf\n";
Hal Canaryc172f9b2017-05-27 20:29:44 -0400146 md5.writeText(uuidNamespace);
benjaminwagnerec4d4d72016-03-25 12:59:53 -0700147 double msec = SkTime::GetMSecs();
halcanary34422612015-10-12 10:11:18 -0700148 md5.write(&msec, sizeof(msec));
149 SkTime::DateTime dateTime;
150 SkTime::GetDateTime(&dateTime);
151 md5.write(&dateTime, sizeof(dateTime));
halcanary4b656662016-04-27 07:45:18 -0700152 if (metadata.fCreation.fEnabled) {
153 md5.write(&metadata.fCreation.fDateTime,
154 sizeof(metadata.fCreation.fDateTime));
halcanary34422612015-10-12 10:11:18 -0700155 }
halcanary4b656662016-04-27 07:45:18 -0700156 if (metadata.fModified.fEnabled) {
157 md5.write(&metadata.fModified.fDateTime,
158 sizeof(metadata.fModified.fDateTime));
halcanary34422612015-10-12 10:11:18 -0700159 }
halcanary4b656662016-04-27 07:45:18 -0700160
161 for (const auto keyValuePtr : gMetadataKeys) {
Hal Canaryc172f9b2017-05-27 20:29:44 -0400162 md5.writeText(keyValuePtr.key);
halcanary34422612015-10-12 10:11:18 -0700163 md5.write("\037", 1);
halcanary4b656662016-04-27 07:45:18 -0700164 const SkString& value = metadata.*(keyValuePtr.valuePtr);
165 md5.write(value.c_str(), value.size());
halcanary34422612015-10-12 10:11:18 -0700166 md5.write("\036", 1);
167 }
168 SkMD5::Digest digest;
169 md5.finish(digest);
170 // See RFC 4122, page 6-7.
171 digest.data[6] = (digest.data[6] & 0x0F) | 0x30;
172 digest.data[8] = (digest.data[6] & 0x3F) | 0x80;
173 static_assert(sizeof(digest) == sizeof(UUID), "uuid_size");
174 SkPDFMetadata::UUID uuid;
175 memcpy(&uuid, &digest, sizeof(digest));
176 return uuid;
177}
178
halcanary4b656662016-04-27 07:45:18 -0700179sk_sp<SkPDFObject> SkPDFMetadata::MakePdfId(const UUID& doc,
180 const UUID& instance) {
halcanary34422612015-10-12 10:11:18 -0700181 // /ID [ <81b14aafa313db63dbd6f981e49f94f4>
182 // <81b14aafa313db63dbd6f981e49f94f4> ]
halcanaryece83922016-03-08 08:32:12 -0800183 auto array = sk_make_sp<SkPDFArray>();
halcanary4b656662016-04-27 07:45:18 -0700184 static_assert(sizeof(SkPDFMetadata::UUID) == 16, "uuid_size");
halcanary34422612015-10-12 10:11:18 -0700185 array->appendString(
186 SkString(reinterpret_cast<const char*>(&doc), sizeof(UUID)));
187 array->appendString(
188 SkString(reinterpret_cast<const char*>(&instance), sizeof(UUID)));
Kevin Lubickf7621cb2018-04-16 15:51:44 -0400189 return std::move(array);
halcanary34422612015-10-12 10:11:18 -0700190}
191
Hal Canaryd6e6e662017-06-17 10:38:13 -0400192// Convert a block of memory to hexadecimal. Input and output pointers will be
193// moved to end of the range.
194static void hexify(const uint8_t** inputPtr, char** outputPtr, int count) {
195 SkASSERT(inputPtr && *inputPtr);
196 SkASSERT(outputPtr && *outputPtr);
197 while (count-- > 0) {
198 uint8_t value = *(*inputPtr)++;
199 *(*outputPtr)++ = SkHexadecimalDigits::gLower[value >> 4];
200 *(*outputPtr)++ = SkHexadecimalDigits::gLower[value & 0xF];
201 }
202}
203
halcanary34422612015-10-12 10:11:18 -0700204static SkString uuid_to_string(const SkPDFMetadata::UUID& uuid) {
205 // 8-4-4-4-12
206 char buffer[36]; // [32 + 4]
halcanary34422612015-10-12 10:11:18 -0700207 char* ptr = buffer;
208 const uint8_t* data = uuid.fData;
Hal Canaryd6e6e662017-06-17 10:38:13 -0400209 hexify(&data, &ptr, 4);
halcanary34422612015-10-12 10:11:18 -0700210 *ptr++ = '-';
Hal Canaryd6e6e662017-06-17 10:38:13 -0400211 hexify(&data, &ptr, 2);
halcanary34422612015-10-12 10:11:18 -0700212 *ptr++ = '-';
Hal Canaryd6e6e662017-06-17 10:38:13 -0400213 hexify(&data, &ptr, 2);
halcanary34422612015-10-12 10:11:18 -0700214 *ptr++ = '-';
Hal Canaryd6e6e662017-06-17 10:38:13 -0400215 hexify(&data, &ptr, 2);
halcanary34422612015-10-12 10:11:18 -0700216 *ptr++ = '-';
Hal Canaryd6e6e662017-06-17 10:38:13 -0400217 hexify(&data, &ptr, 6);
halcanary34422612015-10-12 10:11:18 -0700218 SkASSERT(ptr == buffer + 36);
219 SkASSERT(data == uuid.fData + 16);
220 return SkString(buffer, 36);
221}
halcanary34422612015-10-12 10:11:18 -0700222
223namespace {
halcanary70d15542015-11-22 12:55:04 -0800224class PDFXMLObject final : public SkPDFObject {
halcanary34422612015-10-12 10:11:18 -0700225public:
bungeman221524d2016-01-05 14:59:40 -0800226 PDFXMLObject(SkString xml) : fXML(std::move(xml)) {}
halcanary34422612015-10-12 10:11:18 -0700227 void emitObject(SkWStream* stream,
halcanary530032a2016-08-18 14:22:52 -0700228 const SkPDFObjNumMap& omap) const override {
halcanary34422612015-10-12 10:11:18 -0700229 SkPDFDict dict("Metadata");
230 dict.insertName("Subtype", "XML");
231 dict.insertInt("Length", fXML.size());
halcanary530032a2016-08-18 14:22:52 -0700232 dict.emitObject(stream, omap);
halcanary34422612015-10-12 10:11:18 -0700233 static const char streamBegin[] = " stream\n";
Hal Canaryc172f9b2017-05-27 20:29:44 -0400234 stream->writeText(streamBegin);
halcanary34422612015-10-12 10:11:18 -0700235 // Do not compress this. The standard requires that a
236 // program that does not understand PDF can grep for
Hal Canary55325b72017-01-03 10:36:17 -0500237 // "<?xpacket" and extract the entire XML.
halcanary34422612015-10-12 10:11:18 -0700238 stream->write(fXML.c_str(), fXML.size());
239 static const char streamEnd[] = "\nendstream";
Hal Canaryc172f9b2017-05-27 20:29:44 -0400240 stream->writeText(streamEnd);
halcanary34422612015-10-12 10:11:18 -0700241 }
242
243private:
244 const SkString fXML;
245};
246} // namespace
247
248static int count_xml_escape_size(const SkString& input) {
249 int extra = 0;
250 for (size_t i = 0; i < input.size(); ++i) {
251 if (input[i] == '&') {
252 extra += 4; // strlen("&amp;") - strlen("&")
253 } else if (input[i] == '<') {
254 extra += 3; // strlen("&lt;") - strlen("<")
255 }
256 }
257 return extra;
258}
259
260const SkString escape_xml(const SkString& input,
261 const char* before = nullptr,
262 const char* after = nullptr) {
263 if (input.size() == 0) {
264 return input;
265 }
266 // "&" --> "&amp;" and "<" --> "&lt;"
267 // text is assumed to be in UTF-8
268 // all strings are xml content, not attribute values.
269 size_t beforeLen = before ? strlen(before) : 0;
270 size_t afterLen = after ? strlen(after) : 0;
271 int extra = count_xml_escape_size(input);
272 SkString output(input.size() + extra + beforeLen + afterLen);
273 char* out = output.writable_str();
274 if (before) {
275 strncpy(out, before, beforeLen);
276 out += beforeLen;
277 }
278 static const char kAmp[] = "&amp;";
279 static const char kLt[] = "&lt;";
280 for (size_t i = 0; i < input.size(); ++i) {
281 if (input[i] == '&') {
282 strncpy(out, kAmp, strlen(kAmp));
283 out += strlen(kAmp);
284 } else if (input[i] == '<') {
285 strncpy(out, kLt, strlen(kLt));
286 out += strlen(kLt);
287 } else {
288 *out++ = input[i];
289 }
290 }
291 if (after) {
292 strncpy(out, after, afterLen);
293 out += afterLen;
294 }
295 // Validate that we haven't written outside of our string.
296 SkASSERT(out == &output.writable_str()[output.size()]);
297 *out = '\0';
halcanary78daeff2016-04-07 12:34:59 -0700298 return output;
halcanary34422612015-10-12 10:11:18 -0700299}
300
halcanary4b656662016-04-27 07:45:18 -0700301sk_sp<SkPDFObject> SkPDFMetadata::MakeXMPObject(
302 const SkDocument::PDFMetadata& metadata,
303 const UUID& doc,
304 const UUID& instance) {
halcanary34422612015-10-12 10:11:18 -0700305 static const char templateString[] =
306 "<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n"
307 "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\"\n"
308 " x:xmptk=\"Adobe XMP Core 5.4-c005 78.147326, "
309 "2012/08/23-13:03:03\">\n"
310 "<rdf:RDF "
311 "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
312 "<rdf:Description rdf:about=\"\"\n"
313 " xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\"\n"
314 " xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n"
315 " xmlns:xmpMM=\"http://ns.adobe.com/xap/1.0/mm/\"\n"
316 " xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\"\n"
317 " xmlns:pdfaid=\"http://www.aiim.org/pdfa/ns/id/\">\n"
318 "<pdfaid:part>2</pdfaid:part>\n"
319 "<pdfaid:conformance>B</pdfaid:conformance>\n"
320 "%s" // ModifyDate
321 "%s" // CreateDate
halcanary34422612015-10-12 10:11:18 -0700322 "%s" // xmp:CreatorTool
323 "<dc:format>application/pdf</dc:format>\n"
324 "%s" // dc:title
325 "%s" // dc:description
326 "%s" // author
327 "%s" // keywords
328 "<xmpMM:DocumentID>uuid:%s</xmpMM:DocumentID>\n"
329 "<xmpMM:InstanceID>uuid:%s</xmpMM:InstanceID>\n"
halcanary9f4b3322016-06-30 08:22:04 -0700330 "%s" // pdf:Producer
halcanary34422612015-10-12 10:11:18 -0700331 "%s" // pdf:Keywords
332 "</rdf:Description>\n"
333 "</rdf:RDF>\n"
334 "</x:xmpmeta>\n" // Note: the standard suggests 4k of padding.
335 "<?xpacket end=\"w\"?>\n";
336
337 SkString creationDate;
338 SkString modificationDate;
halcanary4b656662016-04-27 07:45:18 -0700339 if (metadata.fCreation.fEnabled) {
halcanary34422612015-10-12 10:11:18 -0700340 SkString tmp;
halcanary4b656662016-04-27 07:45:18 -0700341 metadata.fCreation.fDateTime.toISO8601(&tmp);
halcanary34422612015-10-12 10:11:18 -0700342 SkASSERT(0 == count_xml_escape_size(tmp));
343 // YYYY-mm-ddTHH:MM:SS[+|-]ZZ:ZZ; no need to escape
halcanaryd51bdae2016-04-25 09:25:35 -0700344 creationDate = SkStringPrintf("<xmp:CreateDate>%s</xmp:CreateDate>\n",
345 tmp.c_str());
halcanary34422612015-10-12 10:11:18 -0700346 }
halcanary4b656662016-04-27 07:45:18 -0700347 if (metadata.fModified.fEnabled) {
halcanary34422612015-10-12 10:11:18 -0700348 SkString tmp;
halcanary4b656662016-04-27 07:45:18 -0700349 metadata.fModified.fDateTime.toISO8601(&tmp);
halcanary34422612015-10-12 10:11:18 -0700350 SkASSERT(0 == count_xml_escape_size(tmp));
halcanaryd51bdae2016-04-25 09:25:35 -0700351 modificationDate = SkStringPrintf(
halcanary34422612015-10-12 10:11:18 -0700352 "<xmp:ModifyDate>%s</xmp:ModifyDate>\n", tmp.c_str());
halcanary34422612015-10-12 10:11:18 -0700353 }
halcanary4b656662016-04-27 07:45:18 -0700354 SkString title =
355 escape_xml(metadata.fTitle,
356 "<dc:title><rdf:Alt><rdf:li xml:lang=\"x-default\">",
357 "</rdf:li></rdf:Alt></dc:title>\n");
358 SkString author =
359 escape_xml(metadata.fAuthor, "<dc:creator><rdf:Bag><rdf:li>",
360 "</rdf:li></rdf:Bag></dc:creator>\n");
halcanary34422612015-10-12 10:11:18 -0700361 // TODO: in theory, XMP can support multiple authors. Split on a delimiter?
halcanary78daeff2016-04-07 12:34:59 -0700362 SkString subject = escape_xml(
halcanary4b656662016-04-27 07:45:18 -0700363 metadata.fSubject,
halcanary78daeff2016-04-07 12:34:59 -0700364 "<dc:description><rdf:Alt><rdf:li xml:lang=\"x-default\">",
365 "</rdf:li></rdf:Alt></dc:description>\n");
halcanary4b656662016-04-27 07:45:18 -0700366 SkString keywords1 =
367 escape_xml(metadata.fKeywords, "<dc:subject><rdf:Bag><rdf:li>",
368 "</rdf:li></rdf:Bag></dc:subject>\n");
369 SkString keywords2 = escape_xml(metadata.fKeywords, "<pdf:Keywords>",
370 "</pdf:Keywords>\n");
halcanary34422612015-10-12 10:11:18 -0700371 // TODO: in theory, keywords can be a list too.
halcanary9f4b3322016-06-30 08:22:04 -0700372
halcanary492d6b52016-07-07 12:28:30 -0700373 SkString producer("<pdf:Producer>" SKPDF_PRODUCER "</pdf:Producer>\n");
halcanary9f4b3322016-06-30 08:22:04 -0700374 if (!metadata.fProducer.isEmpty()) {
375 // TODO: register a developer prefix to make
376 // <skia:SKPDF_CUSTOM_PRODUCER_KEY> a real XML tag.
377 producer = escape_xml(
378 metadata.fProducer, "<pdf:Producer>",
379 "</pdf:Producer>\n<!-- <skia:" SKPDF_CUSTOM_PRODUCER_KEY ">"
380 SKPDF_PRODUCER "</skia:" SKPDF_CUSTOM_PRODUCER_KEY "> -->\n");
381 }
382
halcanary4b656662016-04-27 07:45:18 -0700383 SkString creator = escape_xml(metadata.fCreator, "<xmp:CreatorTool>",
halcanary34422612015-10-12 10:11:18 -0700384 "</xmp:CreatorTool>\n");
385 SkString documentID = uuid_to_string(doc); // no need to escape
386 SkASSERT(0 == count_xml_escape_size(documentID));
387 SkString instanceID = uuid_to_string(instance);
388 SkASSERT(0 == count_xml_escape_size(instanceID));
halcanary4b656662016-04-27 07:45:18 -0700389 return sk_make_sp<PDFXMLObject>(SkStringPrintf(
halcanary34422612015-10-12 10:11:18 -0700390 templateString, modificationDate.c_str(), creationDate.c_str(),
halcanary4b656662016-04-27 07:45:18 -0700391 creator.c_str(), title.c_str(), subject.c_str(), author.c_str(),
392 keywords1.c_str(), documentID.c_str(), instanceID.c_str(),
halcanary9f4b3322016-06-30 08:22:04 -0700393 producer.c_str(), keywords2.c_str()));
halcanary34422612015-10-12 10:11:18 -0700394}
395
halcanary9f4b3322016-06-30 08:22:04 -0700396#undef SKPDF_CUSTOM_PRODUCER_KEY
397#undef SKPDF_PRODUCER
halcanary8cd4a242016-04-07 08:56:15 -0700398#undef SKPDF_STRING
399#undef SKPDF_STRING_IMPL