OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkPDFDevice.h" | 8 #include "SkPDFDevice.h" |
9 | 9 |
10 #include "SkAnnotationKeys.h" | 10 #include "SkAnnotationKeys.h" |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 } | 820 } |
821 break; | 821 break; |
822 default: | 822 default: |
823 SkASSERT(false); | 823 SkASSERT(false); |
824 } | 824 } |
825 } | 825 } |
826 | 826 |
827 static sk_sp<SkPDFDict> create_link_annotation(const SkRect& translatedRect) { | 827 static sk_sp<SkPDFDict> create_link_annotation(const SkRect& translatedRect) { |
828 auto annotation = sk_make_sp<SkPDFDict>("Annot"); | 828 auto annotation = sk_make_sp<SkPDFDict>("Annot"); |
829 annotation->insertName("Subtype", "Link"); | 829 annotation->insertName("Subtype", "Link"); |
830 annotation->insertInt("F", 4); // required by ISO 19005 | 830 #ifdef SK_PDF_GENERATE_PDFA |
| 831 annotation->insertInt("F", 4); // required by ISO 19005 |
| 832 #endif |
831 | 833 |
832 auto border = sk_make_sp<SkPDFArray>(); | 834 auto border = sk_make_sp<SkPDFArray>(); |
833 border->reserve(3); | 835 border->reserve(3); |
834 border->appendInt(0); // Horizontal corner radius. | 836 border->appendInt(0); // Horizontal corner radius. |
835 border->appendInt(0); // Vertical corner radius. | 837 border->appendInt(0); // Vertical corner radius. |
836 border->appendInt(0); // Width, 0 = no border. | 838 border->appendInt(0); // Width, 0 = no border. |
837 annotation->insertObject("Border", std::move(border)); | 839 annotation->insertObject("Border", std::move(border)); |
838 | 840 |
839 auto rect = sk_make_sp<SkPDFArray>(); | 841 auto rect = sk_make_sp<SkPDFArray>(); |
840 rect->reserve(4); | 842 rect->reserve(4); |
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2137 if (!pdfimage) { | 2139 if (!pdfimage) { |
2138 return; | 2140 return; |
2139 } | 2141 } |
2140 fDocument->serialize(pdfimage); // serialize images early. | 2142 fDocument->serialize(pdfimage); // serialize images early. |
2141 fDocument->canon()->addPDFBitmap(key, pdfimage); | 2143 fDocument->canon()->addPDFBitmap(key, pdfimage); |
2142 } | 2144 } |
2143 // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject> | 2145 // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject> |
2144 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), | 2146 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), |
2145 &content.entry()->fContent); | 2147 &content.entry()->fContent); |
2146 } | 2148 } |
OLD | NEW |