| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfPageObjectDictionary | 1 #ifndef __DEFINED__SkPdfPageObjectDictionary |
| 2 #define __DEFINED__SkPdfPageObjectDictionary | 2 #define __DEFINED__SkPdfPageObjectDictionary |
| 3 | 3 |
| 4 #include "SkPdfUtils.h" | 4 #include "SkPdfUtils.h" |
| 5 #include "SkPdfEnums_autogen.h" | 5 #include "SkPdfEnums_autogen.h" |
| 6 #include "SkPdfArray_autogen.h" | 6 #include "SkPdfArray_autogen.h" |
| 7 #include "SkPdfDictionary_autogen.h" | 7 #include "SkPdfDictionary_autogen.h" |
| 8 | 8 |
| 9 // Entries in a page object | 9 // Entries in a page object |
| 10 class SkPdfPageObjectDictionary : public SkPdfDictionary { | 10 class SkPdfPageObjectDictionary : public SkPdfDictionary { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 525 |
| 526 SkPdfPageObjectDictionary& operator=(const SkPdfPageObjectDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} | 526 SkPdfPageObjectDictionary& operator=(const SkPdfPageObjectDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} |
| 527 | 527 |
| 528 /** (Required) The type of PDF object that this dictionary describes; must be | 528 /** (Required) The type of PDF object that this dictionary describes; must be |
| 529 * Page for a page object. | 529 * Page for a page object. |
| 530 **/ | 530 **/ |
| 531 bool has_Type() const { | 531 bool has_Type() const { |
| 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 std::string Type() const { | 535 std::string Type() const; |
| 536 std::string ret; | |
| 537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | |
| 538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 539 return ""; | |
| 540 } | |
| 541 | |
| 542 /** (Required; must be an indirect reference) The page tree node that is the im- | 536 /** (Required; must be an indirect reference) The page tree node that is the im- |
| 543 * mediate parent of this page object. | 537 * mediate parent of this page object. |
| 544 **/ | 538 **/ |
| 545 bool has_Parent() const { | 539 bool has_Parent() const { |
| 546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
t", "", NULL)); | 540 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
t", "", NULL)); |
| 547 } | 541 } |
| 548 | 542 |
| 549 SkPdfDictionary* Parent() const { | 543 SkPdfDictionary* Parent() const; |
| 550 SkPdfDictionary* ret; | |
| 551 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
t", "", &ret)) return ret; | |
| 552 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 553 return NULL; | |
| 554 } | |
| 555 | |
| 556 /** (Required if PieceInfo is present; optional otherwise; PDF 1.3) The date and | 544 /** (Required if PieceInfo is present; optional otherwise; PDF 1.3) The date and |
| 557 * time (see Section 3.8.2, "Dates") when the page's contents were most re- | 545 * time (see Section 3.8.2, "Dates") when the page's contents were most re- |
| 558 * cently modified. If a page-piece dictionary (PieceInfo) is present, the | 546 * cently modified. If a page-piece dictionary (PieceInfo) is present, the |
| 559 * modification date is used to ascertain which of the application data dic- | 547 * modification date is used to ascertain which of the application data dic- |
| 560 * tionaries that it contains correspond to the current content of the page | 548 * tionaries that it contains correspond to the current content of the page |
| 561 * (see Section 9.4, "Page-Piece Dictionaries"). | 549 * (see Section 9.4, "Page-Piece Dictionaries"). |
| 562 **/ | 550 **/ |
| 563 bool has_LastModified() const { | 551 bool has_LastModified() const { |
| 564 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastM
odified", "", NULL)); | 552 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastM
odified", "", NULL)); |
| 565 } | 553 } |
| 566 | 554 |
| 567 SkPdfDate LastModified() const { | 555 SkPdfDate LastModified() const; |
| 568 SkPdfDate ret; | |
| 569 if (DateFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastModifie
d", "", &ret)) return ret; | |
| 570 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 571 return SkPdfDate(); | |
| 572 } | |
| 573 | |
| 574 /** (Required; inheritable) A dictionary containing any resources required by | 556 /** (Required; inheritable) A dictionary containing any resources required by |
| 575 * the page (see Section 3.7.2, "Resource Dictionaries"). If the page requires | 557 * the page (see Section 3.7.2, "Resource Dictionaries"). If the page requires |
| 576 * no resources, the value of this entry should be an empty dictionary; omit- | 558 * no resources, the value of this entry should be an empty dictionary; omit- |
| 577 * ting the entry entirely indicates that the resources are to be inherited fro
m | 559 * ting the entry entirely indicates that the resources are to be inherited fro
m |
| 578 * an ancestor node in the page tree. | 560 * an ancestor node in the page tree. |
| 579 **/ | 561 **/ |
| 580 bool has_Resources() const { | 562 bool has_Resources() const { |
| 581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resou
rces", "", NULL)); | 563 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resou
rces", "", NULL)); |
| 582 } | 564 } |
| 583 | 565 |
| 584 SkPdfDictionary* Resources() const { | 566 SkPdfDictionary* Resources() const; |
| 585 SkPdfDictionary* ret; | |
| 586 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resou
rces", "", &ret)) return ret; | |
| 587 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 588 return NULL; | |
| 589 } | |
| 590 | |
| 591 /** (Required; inheritable) A rectangle (see Section 3.8.3, "Rectangles"), ex- | 567 /** (Required; inheritable) A rectangle (see Section 3.8.3, "Rectangles"), ex- |
| 592 * pressed in default user space units, defining the boundaries of the physical | 568 * pressed in default user space units, defining the boundaries of the physical |
| 593 * medium on which the page is intended to be displayed or printed (see | 569 * medium on which the page is intended to be displayed or printed (see |
| 594 * Section 9.10.1, "Page Boundaries"). | 570 * Section 9.10.1, "Page Boundaries"). |
| 595 **/ | 571 **/ |
| 596 bool has_MediaBox() const { | 572 bool has_MediaBox() const { |
| 597 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Media
Box", "", NULL)); | 573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Media
Box", "", NULL)); |
| 598 } | 574 } |
| 599 | 575 |
| 600 SkRect* MediaBox() const { | 576 SkRect* MediaBox() const; |
| 601 SkRect* ret; | |
| 602 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MediaBox"
, "", &ret)) return ret; | |
| 603 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 604 return NULL; | |
| 605 } | |
| 606 | |
| 607 /** (Optional; inheritable) A rectangle, expressed in default user space units, | 577 /** (Optional; inheritable) A rectangle, expressed in default user space units, |
| 608 * defining the visible region of default user space. When the page is dis- | 578 * defining the visible region of default user space. When the page is dis- |
| 609 * played or printed, its contents are to be clipped (cropped) to this rectangl
e | 579 * played or printed, its contents are to be clipped (cropped) to this rectangl
e |
| 610 * and then imposed on the output medium in some implementation- | 580 * and then imposed on the output medium in some implementation- |
| 611 * defined manner (see Section 9.10.1, "Page Boundaries"). Default value: | 581 * defined manner (see Section 9.10.1, "Page Boundaries"). Default value: |
| 612 * the value of MediaBox. | 582 * the value of MediaBox. |
| 613 **/ | 583 **/ |
| 614 bool has_CropBox() const { | 584 bool has_CropBox() const { |
| 615 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropB
ox", "", NULL)); | 585 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropB
ox", "", NULL)); |
| 616 } | 586 } |
| 617 | 587 |
| 618 SkRect* CropBox() const { | 588 SkRect* CropBox() const; |
| 619 SkRect* ret; | |
| 620 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropBox",
"", &ret)) return ret; | |
| 621 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 622 return NULL; | |
| 623 } | |
| 624 | |
| 625 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- | 589 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- |
| 626 * fining the region to which the contents of the page should be clipped | 590 * fining the region to which the contents of the page should be clipped |
| 627 * when output in a production environment (see Section 9.10.1, "Page | 591 * when output in a production environment (see Section 9.10.1, "Page |
| 628 * Boundaries"). Default value: the value of CropBox. | 592 * Boundaries"). Default value: the value of CropBox. |
| 629 **/ | 593 **/ |
| 630 bool has_BleedBox() const { | 594 bool has_BleedBox() const { |
| 631 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Bleed
Box", "", NULL)); | 595 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Bleed
Box", "", NULL)); |
| 632 } | 596 } |
| 633 | 597 |
| 634 SkRect* BleedBox() const { | 598 SkRect* BleedBox() const; |
| 635 SkRect* ret; | |
| 636 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BleedBox"
, "", &ret)) return ret; | |
| 637 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 638 return NULL; | |
| 639 } | |
| 640 | |
| 641 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- | 599 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- |
| 642 * fining the intended dimensions of the finished page after trimming (see | 600 * fining the intended dimensions of the finished page after trimming (see |
| 643 * Section 9.10.1, "Page Boundaries"). Default value: the value of CropBox. | 601 * Section 9.10.1, "Page Boundaries"). Default value: the value of CropBox. |
| 644 **/ | 602 **/ |
| 645 bool has_TrimBox() const { | 603 bool has_TrimBox() const { |
| 646 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimB
ox", "", NULL)); | 604 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimB
ox", "", NULL)); |
| 647 } | 605 } |
| 648 | 606 |
| 649 SkRect* TrimBox() const { | 607 SkRect* TrimBox() const; |
| 650 SkRect* ret; | |
| 651 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimBox",
"", &ret)) return ret; | |
| 652 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 653 return NULL; | |
| 654 } | |
| 655 | |
| 656 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- | 608 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- |
| 657 * fining the extent of the page's meaningful content (including potential | 609 * fining the extent of the page's meaningful content (including potential |
| 658 * white space) as intended by the page's creator (see Section 9.10.1, "Page | 610 * white space) as intended by the page's creator (see Section 9.10.1, "Page |
| 659 * Boundaries"). Default value: the value of CropBox. | 611 * Boundaries"). Default value: the value of CropBox. |
| 660 **/ | 612 **/ |
| 661 bool has_ArtBox() const { | 613 bool has_ArtBox() const { |
| 662 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBo
x", "", NULL)); | 614 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBo
x", "", NULL)); |
| 663 } | 615 } |
| 664 | 616 |
| 665 SkRect* ArtBox() const { | 617 SkRect* ArtBox() const; |
| 666 SkRect* ret; | |
| 667 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBox",
"", &ret)) return ret; | |
| 668 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 669 return NULL; | |
| 670 } | |
| 671 | |
| 672 /** (Optional) A box color information dictionary specifying the colors and | 618 /** (Optional) A box color information dictionary specifying the colors and |
| 673 * other visual characteristics to be used in displaying guidelines on the | 619 * other visual characteristics to be used in displaying guidelines on the |
| 674 * screen for the various page boundaries (see "Display of Page Boundaries" | 620 * screen for the various page boundaries (see "Display of Page Boundaries" |
| 675 * on page 679). If this entry is absent, the viewer application should use its | 621 * on page 679). If this entry is absent, the viewer application should use its |
| 676 * own current default settings. | 622 * own current default settings. |
| 677 **/ | 623 **/ |
| 678 bool has_BoxColorInfo() const { | 624 bool has_BoxColorInfo() const { |
| 679 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BoxCo
lorInfo", "", NULL)); | 625 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BoxCo
lorInfo", "", NULL)); |
| 680 } | 626 } |
| 681 | 627 |
| 682 SkPdfDictionary* BoxColorInfo() const { | 628 SkPdfDictionary* BoxColorInfo() const; |
| 683 SkPdfDictionary* ret; | |
| 684 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BoxCo
lorInfo", "", &ret)) return ret; | |
| 685 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 686 return NULL; | |
| 687 } | |
| 688 | |
| 689 /** (Optional) A content stream (see Section 3.7.1, "Content Streams") de- | 629 /** (Optional) A content stream (see Section 3.7.1, "Content Streams") de- |
| 690 * scribing the contents of this page. If this entry is absent, the page is emp
ty. | 630 * scribing the contents of this page. If this entry is absent, the page is emp
ty. |
| 691 * The value may be either a single stream or an array of streams. If it is an | 631 * The value may be either a single stream or an array of streams. If it is an |
| 692 * array, the effect is as if all of the streams in the array were concatenated
, in | 632 * array, the effect is as if all of the streams in the array were concatenated
, in |
| 693 * order, to form a single stream. This allows a program generating a PDF | 633 * order, to form a single stream. This allows a program generating a PDF |
| 694 * file to create image objects and other resources as they occur, even though | 634 * file to create image objects and other resources as they occur, even though |
| 695 * they interrupt the content stream. The division between streams may | 635 * they interrupt the content stream. The division between streams may |
| 696 * occur only at the boundaries between lexical tokens (see Section 3.1, "Lex- | 636 * occur only at the boundaries between lexical tokens (see Section 3.1, "Lex- |
| 697 * ical Conventions"), but is unrelated to the page's logical content or orga- | 637 * ical Conventions"), but is unrelated to the page's logical content or orga- |
| 698 * nization. Applications that consume or produce PDF files are not required | 638 * nization. Applications that consume or produce PDF files are not required |
| 699 * to preserve the existing structure of the Contents array. (See implementa- | 639 * to preserve the existing structure of the Contents array. (See implementa- |
| 700 * tion note 22 in Appendix H.) | 640 * tion note 22 in Appendix H.) |
| 701 **/ | 641 **/ |
| 702 bool has_Contents() const { | 642 bool has_Contents() const { |
| 703 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); | 643 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); |
| 704 } | 644 } |
| 705 | 645 |
| 706 bool isContentsAStream() const { | 646 bool isContentsAStream() const { |
| 707 SkPdfObject* ret = NULL; | 647 SkPdfObject* ret = NULL; |
| 708 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; | 648 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; |
| 709 return ret->podofo()->HasStream(); | 649 return ret->podofo()->HasStream(); |
| 710 } | 650 } |
| 711 | 651 |
| 712 SkPdfStream* getContentsAsStream() const { | 652 SkPdfStream* getContentsAsStream() const; |
| 713 SkPdfStream* ret = NULL; | |
| 714 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; | |
| 715 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 716 return NULL; | |
| 717 } | |
| 718 | |
| 719 bool isContentsAArray() const { | 653 bool isContentsAArray() const { |
| 720 SkPdfObject* ret = NULL; | 654 SkPdfObject* ret = NULL; |
| 721 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; | 655 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; |
| 722 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 656 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
| 723 } | 657 } |
| 724 | 658 |
| 725 SkPdfArray* getContentsAsArray() const { | 659 SkPdfArray* getContentsAsArray() const; |
| 726 SkPdfArray* ret = NULL; | |
| 727 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents",
"", &ret)) return ret; | |
| 728 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 729 return NULL; | |
| 730 } | |
| 731 | |
| 732 /** (Optional; inheritable) The number of degrees by which the page should | 660 /** (Optional; inheritable) The number of degrees by which the page should |
| 733 * be rotated clockwise when displayed or printed. The value must be a mul- | 661 * be rotated clockwise when displayed or printed. The value must be a mul- |
| 734 * tiple of 90. Default value: 0. | 662 * tiple of 90. Default value: 0. |
| 735 **/ | 663 **/ |
| 736 bool has_Rotate() const { | 664 bool has_Rotate() const { |
| 737 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotat
e", "", NULL)); | 665 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotat
e", "", NULL)); |
| 738 } | 666 } |
| 739 | 667 |
| 740 long Rotate() const { | 668 long Rotate() const; |
| 741 long ret; | |
| 742 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotate", ""
, &ret)) return ret; | |
| 743 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 744 return 0; | |
| 745 } | |
| 746 | |
| 747 /** (Optional; PDF 1.4) A group attributes dictionary specifying the attributes | 669 /** (Optional; PDF 1.4) A group attributes dictionary specifying the attributes |
| 748 * of the page's page group for use in the transparent imaging model (see | 670 * of the page's page group for use in the transparent imaging model (see |
| 749 * Sections 7.3.6, "Page Group," and 7.5.5, "Transparency Group XObjects"). | 671 * Sections 7.3.6, "Page Group," and 7.5.5, "Transparency Group XObjects"). |
| 750 **/ | 672 **/ |
| 751 bool has_Group() const { | 673 bool has_Group() const { |
| 752 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Group
", "", NULL)); | 674 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Group
", "", NULL)); |
| 753 } | 675 } |
| 754 | 676 |
| 755 SkPdfDictionary* Group() const { | 677 SkPdfDictionary* Group() const; |
| 756 SkPdfDictionary* ret; | |
| 757 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Group
", "", &ret)) return ret; | |
| 758 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 759 return NULL; | |
| 760 } | |
| 761 | |
| 762 /** (Optional) A stream object defining the page's thumbnail image (see Sec- | 678 /** (Optional) A stream object defining the page's thumbnail image (see Sec- |
| 763 * tion 8.2.3, "Thumbnail Images"). | 679 * tion 8.2.3, "Thumbnail Images"). |
| 764 **/ | 680 **/ |
| 765 bool has_Thumb() const { | 681 bool has_Thumb() const { |
| 766 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Thumb
", "", NULL)); | 682 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Thumb
", "", NULL)); |
| 767 } | 683 } |
| 768 | 684 |
| 769 SkPdfStream* Thumb() const { | 685 SkPdfStream* Thumb() const; |
| 770 SkPdfStream* ret; | |
| 771 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Thumb", "
", &ret)) return ret; | |
| 772 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 773 return NULL; | |
| 774 } | |
| 775 | |
| 776 /** (Optional; PDF 1.1; recommended if the page contains article beads) An ar- | 686 /** (Optional; PDF 1.1; recommended if the page contains article beads) An ar- |
| 777 * ray of indirect references to article beads appearing on the page (see Sec- | 687 * ray of indirect references to article beads appearing on the page (see Sec- |
| 778 * tion 8.3.2, "Articles"; see also implementation note 23 in Appendix H). | 688 * tion 8.3.2, "Articles"; see also implementation note 23 in Appendix H). |
| 779 * The beads are listed in the array in natural reading order. | 689 * The beads are listed in the array in natural reading order. |
| 780 **/ | 690 **/ |
| 781 bool has_B() const { | 691 bool has_B() const { |
| 782 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "
", NULL)); | 692 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "
", NULL)); |
| 783 } | 693 } |
| 784 | 694 |
| 785 SkPdfArray* B() const { | 695 SkPdfArray* B() const; |
| 786 SkPdfArray* ret; | |
| 787 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &r
et)) return ret; | |
| 788 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 789 return NULL; | |
| 790 } | |
| 791 | |
| 792 /** (Optional; PDF 1.1) The page's display duration (also called its advance | 696 /** (Optional; PDF 1.1) The page's display duration (also called its advance |
| 793 * timing): the maximum length of time, in seconds, that the page will be | 697 * timing): the maximum length of time, in seconds, that the page will be |
| 794 * displayed during presentations before the viewer application automati- | 698 * displayed during presentations before the viewer application automati- |
| 795 * cally advances to the next page (see Section 8.3.3, "Presentations"). By | 699 * cally advances to the next page (see Section 8.3.3, "Presentations"). By |
| 796 * default, the viewer does not advance automatically. | 700 * default, the viewer does not advance automatically. |
| 797 **/ | 701 **/ |
| 798 bool has_Dur() const { | 702 bool has_Dur() const { |
| 799 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dur",
"", NULL)); | 703 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dur",
"", NULL)); |
| 800 } | 704 } |
| 801 | 705 |
| 802 double Dur() const { | 706 double Dur() const; |
| 803 double ret; | |
| 804 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dur", "",
&ret)) return ret; | |
| 805 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 806 return 0; | |
| 807 } | |
| 808 | |
| 809 /** (Optional; PDF 1.1) A transition dictionary describing the transition effect | 707 /** (Optional; PDF 1.1) A transition dictionary describing the transition effect |
| 810 * to be used when displaying the page during presentations (see Section | 708 * to be used when displaying the page during presentations (see Section |
| 811 * 8.3.3, "Presentations"). | 709 * 8.3.3, "Presentations"). |
| 812 **/ | 710 **/ |
| 813 bool has_Trans() const { | 711 bool has_Trans() const { |
| 814 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
", "", NULL)); | 712 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
", "", NULL)); |
| 815 } | 713 } |
| 816 | 714 |
| 817 SkPdfDictionary* Trans() const { | 715 SkPdfDictionary* Trans() const; |
| 818 SkPdfDictionary* ret; | |
| 819 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
", "", &ret)) return ret; | |
| 820 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 821 return NULL; | |
| 822 } | |
| 823 | |
| 824 /** (Optional) An array of annotation dictionaries representing annotations | 716 /** (Optional) An array of annotation dictionaries representing annotations |
| 825 * associated with the page (see Section 8.4, "Annotations"). | 717 * associated with the page (see Section 8.4, "Annotations"). |
| 826 **/ | 718 **/ |
| 827 bool has_Annots() const { | 719 bool has_Annots() const { |
| 828 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annot
s", "", NULL)); | 720 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annot
s", "", NULL)); |
| 829 } | 721 } |
| 830 | 722 |
| 831 SkPdfArray* Annots() const { | 723 SkPdfArray* Annots() const; |
| 832 SkPdfArray* ret; | |
| 833 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "
", &ret)) return ret; | |
| 834 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 835 return NULL; | |
| 836 } | |
| 837 | |
| 838 /** (Optional; PDF 1.2) An additional-actions dictionary defining actions to | 724 /** (Optional; PDF 1.2) An additional-actions dictionary defining actions to |
| 839 * be performed when the page is opened or closed (see Section 8.5.2, "Trig- | 725 * be performed when the page is opened or closed (see Section 8.5.2, "Trig- |
| 840 * ger Events"; see also implementation note 24 in Appendix H). | 726 * ger Events"; see also implementation note 24 in Appendix H). |
| 841 **/ | 727 **/ |
| 842 bool has_AA() const { | 728 bool has_AA() const { |
| 843 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", NULL)); | 729 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", NULL)); |
| 844 } | 730 } |
| 845 | 731 |
| 846 SkPdfDictionary* AA() const { | 732 SkPdfDictionary* AA() const; |
| 847 SkPdfDictionary* ret; | |
| 848 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", &ret)) return ret; | |
| 849 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 850 return NULL; | |
| 851 } | |
| 852 | |
| 853 /** (Optional; PDF 1.4) A metadata stream containing metadata for the page | 733 /** (Optional; PDF 1.4) A metadata stream containing metadata for the page |
| 854 * (see Section 9.2.2, "Metadata Streams"). | 734 * (see Section 9.2.2, "Metadata Streams"). |
| 855 **/ | 735 **/ |
| 856 bool has_Metadata() const { | 736 bool has_Metadata() const { |
| 857 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); | 737 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); |
| 858 } | 738 } |
| 859 | 739 |
| 860 SkPdfStream* Metadata() const { | 740 SkPdfStream* Metadata() const; |
| 861 SkPdfStream* ret; | |
| 862 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; | |
| 863 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 864 return NULL; | |
| 865 } | |
| 866 | |
| 867 /** (Optional; PDF 1.3) A page-piece dictionary associated with the page (see | 741 /** (Optional; PDF 1.3) A page-piece dictionary associated with the page (see |
| 868 * Section 9.4, "Page-Piece Dictionaries"). | 742 * Section 9.4, "Page-Piece Dictionaries"). |
| 869 **/ | 743 **/ |
| 870 bool has_PieceInfo() const { | 744 bool has_PieceInfo() const { |
| 871 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Piece
Info", "", NULL)); | 745 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Piece
Info", "", NULL)); |
| 872 } | 746 } |
| 873 | 747 |
| 874 SkPdfDictionary* PieceInfo() const { | 748 SkPdfDictionary* PieceInfo() const; |
| 875 SkPdfDictionary* ret; | |
| 876 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Piece
Info", "", &ret)) return ret; | |
| 877 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 878 return NULL; | |
| 879 } | |
| 880 | |
| 881 /** (Required if the page contains structural content items; PDF 1.3) The inte- | 749 /** (Required if the page contains structural content items; PDF 1.3) The inte- |
| 882 * ger key of the page's entry in the structural parent tree (see "Finding Stru
c- | 750 * ger key of the page's entry in the structural parent tree (see "Finding Stru
c- |
| 883 * ture Elements from Content Items" on page 600). | 751 * ture Elements from Content Items" on page 600). |
| 884 **/ | 752 **/ |
| 885 bool has_StructParents() const { | 753 bool has_StructParents() const { |
| 886 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc
tParents", "", NULL)); | 754 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc
tParents", "", NULL)); |
| 887 } | 755 } |
| 888 | 756 |
| 889 long StructParents() const { | 757 long StructParents() const; |
| 890 long ret; | |
| 891 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StructParen
ts", "", &ret)) return ret; | |
| 892 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 893 return 0; | |
| 894 } | |
| 895 | |
| 896 /** (Optional; PDF 1.3; indirect reference preferred) The digital identifier of
the | 758 /** (Optional; PDF 1.3; indirect reference preferred) The digital identifier of
the |
| 897 * page's parent Web Capture content set (see Section 9.9.5, "Object At- | 759 * page's parent Web Capture content set (see Section 9.9.5, "Object At- |
| 898 * tributes Related to Web Capture"). | 760 * tributes Related to Web Capture"). |
| 899 **/ | 761 **/ |
| 900 bool has_ID() const { | 762 bool has_ID() const { |
| 901 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID",
"", NULL)); | 763 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID",
"", NULL)); |
| 902 } | 764 } |
| 903 | 765 |
| 904 std::string ID() const { | 766 std::string ID() const; |
| 905 std::string ret; | |
| 906 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "",
&ret)) return ret; | |
| 907 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 908 return ""; | |
| 909 } | |
| 910 | |
| 911 /** (Optional; PDF 1.3) The page's preferred zoom (magnification) factor: the | 767 /** (Optional; PDF 1.3) The page's preferred zoom (magnification) factor: the |
| 912 * factor by which it should be scaled to achieve the "natural" display magni- | 768 * factor by which it should be scaled to achieve the "natural" display magni- |
| 913 * fication (see Section 9.9.5, "Object Attributes Related to Web Capture"). | 769 * fication (see Section 9.9.5, "Object Attributes Related to Web Capture"). |
| 914 **/ | 770 **/ |
| 915 bool has_PZ() const { | 771 bool has_PZ() const { |
| 916 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PZ",
"", NULL)); | 772 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PZ",
"", NULL)); |
| 917 } | 773 } |
| 918 | 774 |
| 919 double PZ() const { | 775 double PZ() const; |
| 920 double ret; | |
| 921 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PZ", "",
&ret)) return ret; | |
| 922 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 923 return 0; | |
| 924 } | |
| 925 | |
| 926 /** (Optional; PDF 1.3) A separation dictionary containing information need- | 776 /** (Optional; PDF 1.3) A separation dictionary containing information need- |
| 927 * ed to generate color separations for the page (see Section 9.10.3, "Separa- | 777 * ed to generate color separations for the page (see Section 9.10.3, "Separa- |
| 928 * tion Dictionaries"). | 778 * tion Dictionaries"). |
| 929 **/ | 779 **/ |
| 930 bool has_SeparationInfo() const { | 780 bool has_SeparationInfo() const { |
| 931 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Separ
ationInfo", "", NULL)); | 781 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Separ
ationInfo", "", NULL)); |
| 932 } | 782 } |
| 933 | 783 |
| 934 SkPdfDictionary* SeparationInfo() const { | 784 SkPdfDictionary* SeparationInfo() const; |
| 935 SkPdfDictionary* ret; | |
| 936 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Separ
ationInfo", "", &ret)) return ret; | |
| 937 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 938 return NULL; | |
| 939 } | |
| 940 | |
| 941 }; | 785 }; |
| 942 | 786 |
| 943 #endif // __DEFINED__SkPdfPageObjectDictionary | 787 #endif // __DEFINED__SkPdfPageObjectDictionary |
| OLD | NEW |