Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.8, 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: Utilities
    • Labels:

      Description

      (This is an idea for the Google Summer of Code 2015)

      Our command line utility PDFDebugger (part of the command line pdfbox-app get it here, read description here, see the source code here) needs some improvements:

      • hex view
      • view of non printable characters
      • ✓ saving streams
      • binary copy & paste
      • ✓ Create a status line that shows where we are in the tree. (Like in the Windows REGEDIT)
      • ✓ Copy the current tree string into the clipboard (useful in discussions about details of a PDF)
      • ✓ (Optional, not sure if easy) Jump to specific place in the tree by entering tree string
      • ✓ ability to search in streams (very useful for content streams and meta data)
      • ✓ show images that are streams
      • ✓ show PDIndexed color lookup table, show the index value, the base and RGB color value sets when the mouse moves
      • ✓ show PDSeparation color
      • ✓ show PDDeviceN colors
      • optional, idea should be developed a bit: show meaningful explanation on some attributes, e.g. "appearance stream" when hovering over /AP
      • show font encodings and characters
      • ✓ display flag bits (e.g. Annotation flags) in a way that is easy to understand. There are probably others, I assume that the main work needs to be done only once
      • edit attributes (should be possible to enter values as decimal, hex or binary)
      • edit streams, while keeping or changing the compression filter
      • save altered PDF
      • ✓ color mark of certain PDF operators, especially Q...q and text operators (BT...ET). Ideally, it should help the user understand the "bracketing" of these operators, i.e. understand where a sequence starts and where it ends. (See "operator summary" in the PDF Spec) Other "important" operators I can think of are the matrix, font and color operators. A cool advanced thing would be to show the current color or the font in a popup when hovering above such an operator.

      To see a product with a similar purpose that is better than PDFDebugger, watch this video.

      I'm not asking to implement a clone of that product (I don't use it, all I know is that video), but we at PDFBox really need something that makes PDF debugging easier. As an example of how the current PDFDebugger prevented me from finding a bug quickly, see PDFBOX-2401 and search for "PDFDebugger".

      Prerequisites:

      • java programming, especially the GUI components
      • the ability to understand existing source code

      Using external software components is possible (must have Apache License or a compatible one), but should be decided on a case-by-case basis, we don't want to get too big.

      Development strategy: go from the easy to the difficult. The wished features are already sorted this way (mostly).

      Get introduced: download the source code with svn and build it with maven. Run PDFDebugger and view some PDFs to see the components of a PDF. Start with the file of PDFBOX-2401. Read up something about the structure of PDF on the web or from the PDF Specification.

      Mentor: Tilman Hausherr (European timezone, languages: german, english, french). To see the GSoC2014 project I mentored, go to PDFBOX-1915.

      1. 317669-p213.pdf
        2 kB
        Tilman Hausherr
      2. ArrayIndexOutOfBound_in_find_menu_resolved.diff
        1 kB
        khyrul bashar
      3. Avoiding_NPE_for_null_Field_Type.diff
        4 kB
        khyrul bashar
      4. BracketsColorChooser.png
        34 kB
        Maruan Sahyoun
      5. Class_cast_exception_in_page_mode_avoided.diff
        0.7 kB
        khyrul bashar
      6. Content_stream_showing_issues_patch_updated.diff
        16 kB
        khyrul bashar
      7. Content_stream_showing_issues_patch.diff
        18 kB
        khyrul bashar
      8. DeviceNCS.diff
        13 kB
        khyrul bashar
      9. filters-screenshot.png
        89 kB
        Tilman Hausherr
      10. Flag_bits_showing_feature.diff
        14 kB
        khyrul bashar
      11. Flag_bits_showing_feature-redesigned.diff
        45 kB
        khyrul bashar
      12. FlagBitsPane-26-06-2015.diff
        47 kB
        khyrul bashar
      13. Font_encoding_pane_draft.diff
        17 kB
        khyrul bashar
      14. Font_encoding_pane_feature_.diff
        18 kB
        khyrul bashar
      15. hex_viewer_v1.diff
        65 kB
        khyrul bashar
      16. indexedcs.diff
        19 kB
        khyrul bashar
      17. Javadoc_for_ZoomMenu_class.diff
        2 kB
        khyrul bashar
      18. K4SystemFontsNotEmbeded218.pdf
        9 kB
        John Hewson
      19. openSelectedPath.diff
        1 kB
        khyrul bashar
      20. Parent_dictionary_type_checking_for__f__and__flags.diff
        2 kB
        khyrul bashar
      21. parent_node_redirect_expand_disabled.diff
        3 kB
        khyrul bashar
      22. parent_node_redirect.diff
        2 kB
        khyrul bashar
      23. PDFDebugger_StatusBar_01.png
        46 kB
        Tanay Abhra
      24. PDFDebugger_StatusBar.png
        156 kB
        Tanay Abhra
      25. refactor_ZoomMenu_to_avoid_code_redundancy.diff
        3 kB
        khyrul bashar
      26. removed_redundant_codes.patch
        6 kB
        khyrul bashar
      27. screenshot-1.png
        60 kB
        Tilman Hausherr
      28. screenshot-2.png
        79 kB
        Tilman Hausherr
      29. screenshot-3.png
        83 kB
        Tilman Hausherr
      30. separationCS.diff
        13 kB
        khyrul bashar
      31. Show_thumbnail_image.diff
        6 kB
        khyrul bashar
      32. sonarqube_issue_resolve_26_07.diff
        2 kB
        khyrul bashar
      33. SonarQube_issues_resolved.diff
        7 kB
        khyrul bashar
      34. sonarqube_warning_for_method_length_resolved.diff
        4 kB
        khyrul bashar
      35. sonarqube_warning_resolve.diff
        1 kB
        khyrul bashar
      36. Sonarqube_warning_resolved.diff
        17 kB
        khyrul bashar
      37. Stream_Showing_Feature.diff
        76 kB
        khyrul bashar
      38. Stream_text_showing_for_broken_streams.diff
        2 kB
        khyrul bashar
      39. tree.diff
        23 kB
        khyrul bashar
      40. treestatus.diff
        4 kB
        khyrul bashar
      41. treestatuspane.diff
        15 kB
        khyrul bashar
      42. Zoom_menu_refactored_and_enabled_for_images.diff
        17 kB
        khyrul bashar

        Activity

        Hide
        jahewson John Hewson added a comment -

        Showing font encodings and characters would be great too.

        Show
        jahewson John Hewson added a comment - Showing font encodings and characters would be great too.
        Hide
        kbashar khyrul bashar added a comment -

        I'm interested to work on this project in next summer.
        To get Introduced I've made a first look up in source code. Now trying to understand the architecture of PDFBox and thus spending time to understand structure of PDF itself.
        I need some guideline. how to prepare for the project and what are the topics I should know beforehand to work on this project.

        Show
        kbashar khyrul bashar added a comment - I'm interested to work on this project in next summer. To get Introduced I've made a first look up in source code. Now trying to understand the architecture of PDFBox and thus spending time to understand structure of PDF itself. I need some guideline. how to prepare for the project and what are the topics I should know beforehand to work on this project.
        Hide
        tilman Tilman Hausherr added a comment -

        I've added a bit about this in the top part, i.e. get the code to build and read the PDF specification. Btw, as a warning of sorts, I had three applications for my 2014 project which required unusual skills. This one doesn't (except know about Java GUI, and not be scared by the size of the PDF specification), so don't concentrate on a single GSoC project

        Show
        tilman Tilman Hausherr added a comment - I've added a bit about this in the top part, i.e. get the code to build and read the PDF specification. Btw, as a warning of sorts, I had three applications for my 2014 project which required unusual skills. This one doesn't (except know about Java GUI, and not be scared by the size of the PDF specification), so don't concentrate on a single GSoC project
        Hide
        tilman Tilman Hausherr added a comment -

        Quick intro on PDIndexed, PDSeparation and PDDeviceN colorspaces:

        • Indexed: the color value (0... 255) is an index into a table of color values. This index can be displayed as a colored bar, see this line in the code:
          BufferedImage rgbImage = baseColorSpace.toRGBImage(baseRaster);

          that image is what I want to see in the debugger, but higher than just one pixel. (Try saving that image into a file, then display it to see what I mean)

        • Separation: the color value (0...1) tells how much to use of a specific colorant (the spec mentions metallic and fluorescent colors and special textures), i.e. the result will vary between the lightest and the darkest colorant that can (approximatly) be represented by a color combination in the RGB space. So all I need is a bar showing these colors. The actual look on the RGB screen is calculated with the tintTransform function.
        • DeviceN: this is like CMYK but with N arbitrary colors instead of C, M Y and K. The actual look is calculated with the tintTransform function. All needed to display would be these colors, the maximum and minimum values individually, see the first file in PDFBOX-1870 and trace through PDDeviceN.

        The PD* colorspace classes are not to be changed. You need to create your output with the methods that already exist, e.g. by calling toRGB()

        Btw to get a better understanding of color spaces, read the difference between RGB and CMYK on wikipedia and understand what "additive" and "substractive" means.

        Show
        tilman Tilman Hausherr added a comment - Quick intro on PDIndexed, PDSeparation and PDDeviceN colorspaces: Indexed: the color value (0... 255) is an index into a table of color values. This index can be displayed as a colored bar, see this line in the code: BufferedImage rgbImage = baseColorSpace.toRGBImage(baseRaster); that image is what I want to see in the debugger, but higher than just one pixel. (Try saving that image into a file, then display it to see what I mean) Separation: the color value (0...1) tells how much to use of a specific colorant (the spec mentions metallic and fluorescent colors and special textures), i.e. the result will vary between the lightest and the darkest colorant that can (approximatly) be represented by a color combination in the RGB space. So all I need is a bar showing these colors. The actual look on the RGB screen is calculated with the tintTransform function. DeviceN: this is like CMYK but with N arbitrary colors instead of C, M Y and K. The actual look is calculated with the tintTransform function. All needed to display would be these colors, the maximum and minimum values individually, see the first file in PDFBOX-1870 and trace through PDDeviceN. The PD* colorspace classes are not to be changed. You need to create your output with the methods that already exist, e.g. by calling toRGB() Btw to get a better understanding of color spaces, read the difference between RGB and CMYK on wikipedia and understand what "additive" and "substractive" means.
        Hide
        tilman Tilman Hausherr added a comment -

        Hey students! Read this:
        http://community.apache.org/gsoc.html

        Show
        tilman Tilman Hausherr added a comment - Hey students! Read this: http://community.apache.org/gsoc.html
        Hide
        axelrose Axel Rose added a comment - - edited

        I once wrote a little utility to have all the infos from PDFDebugger in a XML output file.
        See https://issues.apache.org/jira/browse/PDFBOX-1710

        I suggested this as an enhancement but it was rejected. Perhaps this is now another opportunity.
        I'd like to have an XML report from PDFDebugger!

        Show
        axelrose Axel Rose added a comment - - edited I once wrote a little utility to have all the infos from PDFDebugger in a XML output file. See https://issues.apache.org/jira/browse/PDFBOX-1710 I suggested this as an enhancement but it was rejected. Perhaps this is now another opportunity. I'd like to have an XML report from PDFDebugger!
        Hide
        tilman Tilman Hausherr added a comment -

        I'm glad you're still with us despite the "rejection"

        However, although I don't always agree with John often, this time I do - what would this be useful for? I don't see it. And you have an "XML report from PDFDebugger", as you wrote some code to do it. Maybe you have some use for it yourself, but what would the use be for the rest of the world?

        Show
        tilman Tilman Hausherr added a comment - I'm glad you're still with us despite the "rejection" However, although I don't always agree with John often, this time I do - what would this be useful for? I don't see it. And you have an "XML report from PDFDebugger", as you wrote some code to do it. Maybe you have some use for it yourself, but what would the use be for the rest of the world?
        Hide
        axelrose Axel Rose added a comment -

        Hi Tilman,

        I think it is as useful as the debugger is useful.

        With PDFDebugger I have the structural info in a GUI but cannot save and share it.
        With an XML (or whatever textual) report I could show it other people or analyze it
        further for whatever reason.

        I don't care much where to put such a feature to but still hope other would find
        it useful too.

        Best, Axel.

        Show
        axelrose Axel Rose added a comment - Hi Tilman, I think it is as useful as the debugger is useful. With PDFDebugger I have the structural info in a GUI but cannot save and share it. With an XML (or whatever textual) report I could show it other people or analyze it further for whatever reason. I don't care much where to put such a feature to but still hope other would find it useful too. Best, Axel.
        Hide
        tilman Tilman Hausherr added a comment -

        You don't have to save the structural information, you have the PDF! XML isn't that good to look at - one would need a viewer. I still don't see the advantage. Either you get the original PDF, or a nice display of it with the debugger. XML isn't really user-friendly. You can share the PDF, or share snippets that you either cut from the raw data, or from a decoded stream in the debugger.

        Show
        tilman Tilman Hausherr added a comment - You don't have to save the structural information, you have the PDF! XML isn't that good to look at - one would need a viewer. I still don't see the advantage. Either you get the original PDF, or a nice display of it with the debugger. XML isn't really user-friendly. You can share the PDF, or share snippets that you either cut from the raw data, or from a decoded stream in the debugger.
        Hide
        tanayabh Tanay Abhra added a comment -

        Hi Tilman,

        I have been watching and lurking on this thread before the GSoC period
        started, but couldn't contribute as I was sick for the week or so.

        I have compiled and setup the program and have gone through the PDF Specification a little.
        I have also worked on one of the above tasks,

        • Create a status line that shows where we are in the tree. (Like in the Windows REGEDIT)

        I have attached the resulting screenshots. What should be my way forward?

        1. Work on another subtask?
        2. Work on an unrelated issue. (If yes, can you point me towards any low hanging fruit)
        3. Submit a rough draft of the proposal so that you can review it
        4. Polish the patches for the status bar, so that they are suitable for submission.

        Cheers,
        Tanay Abhra.

        Show
        tanayabh Tanay Abhra added a comment - Hi Tilman, I have been watching and lurking on this thread before the GSoC period started, but couldn't contribute as I was sick for the week or so. I have compiled and setup the program and have gone through the PDF Specification a little. I have also worked on one of the above tasks, Create a status line that shows where we are in the tree. (Like in the Windows REGEDIT) I have attached the resulting screenshots. What should be my way forward? 1. Work on another subtask? 2. Work on an unrelated issue. (If yes, can you point me towards any low hanging fruit) 3. Submit a rough draft of the proposal so that you can review it 4. Polish the patches for the status bar, so that they are suitable for submission. Cheers, Tanay Abhra.
        Hide
        tanayabh Tanay Abhra added a comment -

        Hi, Please review if the status bar looks adequate or needs some changes.

        Show
        tanayabh Tanay Abhra added a comment - Hi, Please review if the status bar looks adequate or needs some changes.
        Hide
        tilman Tilman Hausherr added a comment -

        You can still apply for GSoC! The application period starts starts March 16. I suggest you submit your draft in Melange, if I remember correctly, it can be replaced, e.g. because you get feedback about something missing. Please don't code for this issue, as this should be done by the chosen student. The screenshot looks nice, although the types (e.g. Dictionary) are not needed.

        What you can do, so that the effort isn't completely lost, is to mention what GUI classes you used. (if you want)

        Re low hanging fruits - sadly, the other issues are really complex. If this is about getting coding practice, try BATIK-1109 and BATIK-1110. One of the bugs is probably fixed by a few lines (although some debugging is needed to see how signed / unsigned values are handled there), the other one involves using code in PDFBox but in the way BATIK uses. Both bugs have been fixed in PDFBox, but not in BATIK (of which PDFBox used some code).

        Show
        tilman Tilman Hausherr added a comment - You can still apply for GSoC! The application period starts starts March 16. I suggest you submit your draft in Melange, if I remember correctly, it can be replaced, e.g. because you get feedback about something missing. Please don't code for this issue, as this should be done by the chosen student. The screenshot looks nice, although the types (e.g. Dictionary) are not needed. What you can do, so that the effort isn't completely lost, is to mention what GUI classes you used. (if you want) Re low hanging fruits - sadly, the other issues are really complex. If this is about getting coding practice, try BATIK-1109 and BATIK-1110 . One of the bugs is probably fixed by a few lines (although some debugging is needed to see how signed / unsigned values are handled there), the other one involves using code in PDFBox but in the way BATIK uses. Both bugs have been fixed in PDFBox, but not in BATIK (of which PDFBox used some code).
        Hide
        torakiki Andrea Vacondio added a comment -

        Something I feel is missing while I'm using the PDFDebugger is:

        • Open pdf documents by Dragging them from the OS file explorer and dropping on the PDFDebugger
        • A tabbed view where each tab is an open document
        • A recent menu or something similar where recently opened docs can be selected
        Show
        torakiki Andrea Vacondio added a comment - Something I feel is missing while I'm using the PDFDebugger is: Open pdf documents by Dragging them from the OS file explorer and dropping on the PDFDebugger A tabbed view where each tab is an open document A recent menu or something similar where recently opened docs can be selected
        Hide
        kbashar khyrul bashar added a comment - - edited

        A recent menu will be actually a nice thing to have in PDFDebugger.I also feel the need of this sometimes. At least PDFDebugger should open file opening dialog from the last path it was used.

        Show
        kbashar khyrul bashar added a comment - - edited A recent menu will be actually a nice thing to have in PDFDebugger.I also feel the need of this sometimes. At least PDFDebugger should open file opening dialog from the last path it was used.
        Hide
        tanayabh Tanay Abhra added a comment -

        Thank you for the suggestion, I shall add them in my proposal.

        Show
        tanayabh Tanay Abhra added a comment - Thank you for the suggestion, I shall add them in my proposal.
        Hide
        tilman Tilman Hausherr added a comment - - edited

        The "recent" menu is definitively a good idea. The tabbed view - yes, why not. I like it, but I know what many people think that this is "so 90ies". Drag and drop would be great, however I remember reading that this is OS dependent.

        The application window has opened, so technically we can't "require" new stuff from students from now on.

        Show
        tilman Tilman Hausherr added a comment - - edited The "recent" menu is definitively a good idea. The tabbed view - yes, why not. I like it, but I know what many people think that this is "so 90ies". Drag and drop would be great, however I remember reading that this is OS dependent. The application window has opened, so technically we can't "require" new stuff from students from now on.
        Hide
        tilman Tilman Hausherr added a comment -

        This proposal structure was mentioned in the mentor mailing list. It is very good, and will probably land on the URL I posted earlier:

        Lists the points to cover, which you could easily turn onto a template:
        
        # About me
        
        What relevant experience have you got, including university, work and hobby activities?
        
        # Background
        
        What exists already? What is the identified need? What can you reuse, what needs to he replaced?
        
        # Design / description of work
        
        Brief list of things you will do / create, in some rough chronological order.
        
        E.g. "Investigate Android REST client libraries" or "Develop JavaScript functions for browsing files"
        
        Show which bits are essential, and which are optional.
        
        Also highlight what is new, what is modifications, and how your work fits into the existing architecture.
        
        # Results for the Apache community
        
        Benefit of your work to Apache $Project users and developers. What will be the legacy of your work after you finish?
        
        # Deliverables
        
        Including milestones, components, documentation, tests
        
        # Scheduling
        
        Not too detailed, but some milestones and checkpoints. Rough estimates per work item (weeks/days). Remember to leave time for slack and bugfixing!
        
        ## other commitments
        
        Exams, part time work, holidays, lectures.
        
        # Community engagement
        
        In particular with Apache $Project.
        
        This should show a rough understanding of working with open source communities.
        
        Both before start (e.g. this email) and during the project. This includes mailing lists, wikis, issue trackers, test systems.
        
        Any planned user testing, prototypes, code review.
        
        Show
        tilman Tilman Hausherr added a comment - This proposal structure was mentioned in the mentor mailing list. It is very good, and will probably land on the URL I posted earlier: Lists the points to cover, which you could easily turn onto a template: # About me What relevant experience have you got, including university, work and hobby activities? # Background What exists already? What is the identified need? What can you reuse, what needs to he replaced? # Design / description of work Brief list of things you will do / create, in some rough chronological order. E.g. "Investigate Android REST client libraries" or "Develop JavaScript functions for browsing files" Show which bits are essential, and which are optional. Also highlight what is new , what is modifications, and how your work fits into the existing architecture. # Results for the Apache community Benefit of your work to Apache $Project users and developers. What will be the legacy of your work after you finish? # Deliverables Including milestones, components, documentation, tests # Scheduling Not too detailed, but some milestones and checkpoints. Rough estimates per work item (weeks/days). Remember to leave time for slack and bugfixing! ## other commitments Exams, part time work, holidays, lectures. # Community engagement In particular with Apache $Project. This should show a rough understanding of working with open source communities. Both before start (e.g. this email) and during the project. This includes mailing lists, wikis, issue trackers, test systems. Any planned user testing, prototypes, code review.
        Hide
        tilman Tilman Hausherr added a comment -

        It is now past 27.3 19:00 UTC and google melange shows two applications. Thank you both! The winner will be announced in exactly 1 month. I'm not allowed to describe the Apache ranking process (don't worry, there's nothing nasty there), nor to announce the winner before google does so. (If there is one - it depends if apache gets enough slots from google.)

        Please do NOT work on this issue, do not submit any code here, as this would be unfair towards the other student. You can of course work on other issues or create new ones if you like (but don't create issues for "how to" questions - ask on the mailing lists). You're not losing anything by reading or working on something even if you don't get accepted. All work you do is practice, and even mistakes make you a more experienced developer.

        Show
        tilman Tilman Hausherr added a comment - It is now past 27.3 19:00 UTC and google melange shows two applications. Thank you both! The winner will be announced in exactly 1 month. I'm not allowed to describe the Apache ranking process (don't worry, there's nothing nasty there), nor to announce the winner before google does so. (If there is one - it depends if apache gets enough slots from google.) Please do NOT work on this issue, do not submit any code here, as this would be unfair towards the other student. You can of course work on other issues or create new ones if you like (but don't create issues for "how to" questions - ask on the mailing lists). You're not losing anything by reading or working on something even if you don't get accepted. All work you do is practice, and even mistakes make you a more experienced developer.
        Hide
        tilman Tilman Hausherr added a comment - - edited

        The list of accepted projects by google is now online:
        https://www.google-melange.com/gsoc/projects/list/google/gsoc2015

        So welcome khyrul bashar to GSoC2015!

        To Tanay Abhra - sorry, your proposal was good too (and I would have been fine with you if Khyrul had dropped out or be assigned to another project), but his proposal was slightly better. E-mail me if you want more feedback.

        Andreas Lehmkühler please add khyrul bashar as "user" in JIRA

        khyrul bashar please send a signed ICLA to apache
        https://www.apache.org/licenses/icla.txt

        Read my advice from last year and some comments by Andreas:
        https://mail-archives.apache.org/mod_mbox/pdfbox-dev/201404.mbox/%3C628414000.644564.1398334416516.open-xchange@ptangptang.store%3E

        Show
        tilman Tilman Hausherr added a comment - - edited The list of accepted projects by google is now online: https://www.google-melange.com/gsoc/projects/list/google/gsoc2015 So welcome khyrul bashar to GSoC2015! To Tanay Abhra - sorry, your proposal was good too (and I would have been fine with you if Khyrul had dropped out or be assigned to another project), but his proposal was slightly better. E-mail me if you want more feedback. Andreas Lehmkühler please add khyrul bashar as "user" in JIRA khyrul bashar please send a signed ICLA to apache https://www.apache.org/licenses/icla.txt Read my advice from last year and some comments by Andreas: https://mail-archives.apache.org/mod_mbox/pdfbox-dev/201404.mbox/%3C628414000.644564.1398334416516.open-xchange@ptangptang.store%3E
        Hide
        tilman Tilman Hausherr added a comment - - edited

        More ideas (not required, this is optional, to be done if enough time left):

        Jump to page. Due to the complex nested structure of pages (kids with kids), it is quite difficult to access a specific page. So the code should go through this tree to find the page one gets with PDDocument.getPages().get(index) and then jump to that node and show it.

        Use extension when saving a stream, if type of stream is known.

        • use .jpeg if filter has DCTDecode
        • use .xml if /Type/Metadata and /Subtype /XML
        • use .icc if /Type /OutputIntent or known to be icc profile for other reason
        • use .txt if known to be content stream
        Show
        tilman Tilman Hausherr added a comment - - edited More ideas (not required, this is optional, to be done if enough time left): Jump to page. Due to the complex nested structure of pages (kids with kids), it is quite difficult to access a specific page. So the code should go through this tree to find the page one gets with PDDocument.getPages().get(index) and then jump to that node and show it. Use extension when saving a stream, if type of stream is known. use .jpeg if filter has DCTDecode use .xml if /Type/Metadata and /Subtype /XML use .icc if /Type /OutputIntent or known to be icc profile for other reason use .txt if known to be content stream
        Hide
        lehmi Andreas Lehmkühler added a comment -

        Andreas Lehmkühler please add khyrul bashar as "user" in JIRA

        I've added khyrul bashar as Contributor to the PDFBox JIRA project, similar to Shaola.

        Show
        lehmi Andreas Lehmkühler added a comment - Andreas Lehmkühler please add khyrul bashar as "user" in JIRA I've added khyrul bashar as Contributor to the PDFBox JIRA project, similar to Shaola.
        Hide
        kbashar khyrul bashar added a comment - - edited

        I've started to code. I'm using GitHub and this is my repository link https://github.com/kBashar/pdfbox. Currently, I'm coding to implement the tree status string feature (5,6 no from above list). I've written the code without test codes.
        Anyway, what should be my approach for test code when there is a private method?

        Show
        kbashar khyrul bashar added a comment - - edited I've started to code. I'm using GitHub and this is my repository link https://github.com/kBashar/pdfbox . Currently, I'm coding to implement the tree status string feature (5,6 no from above list). I've written the code without test codes. Anyway, what should be my approach for test code when there is a private method?
        Hide
        tilman Tilman Hausherr added a comment -

        Make it package protected (remove "private"), or test the caller, if possible.

        I'm aware that this is a hot topic, a google search on "unit test private method" finds quite a lot

        Show
        tilman Tilman Hausherr added a comment - Make it package protected (remove "private"), or test the caller, if possible. I'm aware that this is a hot topic, a google search on "unit test private method" finds quite a lot
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1680689 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1680689 ]

        PDFBOX-2530: add recent files feature, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1680689 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1680689 ] PDFBOX-2530 : add recent files feature, as done by Khyrul Bashar in GSoC2015
        Hide
        kbashar khyrul bashar added a comment -

        Tree status line showing where we are in the tree. This is editable i.e. status line can be inputted as string and browse the tree.

        Show
        kbashar khyrul bashar added a comment - Tree status line showing where we are in the tree. This is editable i.e. status line can be inputted as string and browse the tree.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1681588 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1681588 ]

        PDFBOX-2530: Tree status line show & input feature, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1681588 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1681588 ] PDFBOX-2530 : Tree status line show & input feature, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks. I am committing your changes with some modifications, most of them minor, just compare with your own code and you'll understand. Two things however I'd like to mention:

        • don't use "_variable". We don't do this (although I've seen it in older code)
        • avoid throwing RuntimeException, unless there's really no other solution. I removed both cases; one I replaced with IllegalArgumentException, the other one I returned null. Because you're assigning null later anyway.

        One small wish: is it possible that when opening a file, the focus isn't on "Info" but on the root?

        Show
        tilman Tilman Hausherr added a comment - Thanks. I am committing your changes with some modifications, most of them minor, just compare with your own code and you'll understand. Two things however I'd like to mention: don't use "_variable". We don't do this (although I've seen it in older code) avoid throwing RuntimeException, unless there's really no other solution. I removed both cases; one I replaced with IllegalArgumentException, the other one I returned null. Because you're assigning null later anyway. One small wish: is it possible that when opening a file, the focus isn't on "Info" but on the root?
        Hide
        kbashar khyrul bashar added a comment -

        okay I'll code this in the next patch.

        Show
        kbashar khyrul bashar added a comment - okay I'll code this in the next patch.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1681747 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1681747 ]

        PDFBOX-2530, PDFBOX-2576: use interface instead of class; use method instead of field

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1681747 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1681747 ] PDFBOX-2530 , PDFBOX-2576 : use interface instead of class; use method instead of field
        Hide
        tilman Tilman Hausherr added a comment - - edited

        I did some slight refactoring based on this morning SonarQube run (look for "Added: +8" and click on the 8 to see the issues). I don't agree with all the complaints, but some of them help create better code, in this case the request that isValid be private and have accessors. My observation is that it is mostly identical to path being not null, so I changed it accordingly.

        But looking further, I'm not even sure if isValid() is needed at all, it is used only once: in the line

        statusObj.getPathForString()
        

        I'm having a bad feeling on that one. From the name and the javadoc, it "gets" something. From the code

            /**
             * Provides TreePath for a given status string. In case of invalid string returns null.
             * @param statusString
             * @return path.
             */
            public TreePath getPathForString(String statusString)
            {
                setPathString(statusString);
                return path;
            }
        

        it also sets something. So this is confusing. It breaks the "do one thing" advice of "Uncle Bob". I would ask you to somehow separate "setting" and "getting", even if it means code getting larger, e.g. because you're setting something first, then getting some result from the object you worked on.

        Show
        tilman Tilman Hausherr added a comment - - edited I did some slight refactoring based on this morning SonarQube run (look for "Added: +8" and click on the 8 to see the issues). I don't agree with all the complaints, but some of them help create better code, in this case the request that isValid be private and have accessors. My observation is that it is mostly identical to path being not null, so I changed it accordingly. But looking further, I'm not even sure if isValid() is needed at all, it is used only once: in the line statusObj.getPathForString() I'm having a bad feeling on that one. From the name and the javadoc, it "gets" something. From the code /** * Provides TreePath for a given status string. In case of invalid string returns null . * @param statusString * @ return path. */ public TreePath getPathForString( String statusString) { setPathString(statusString); return path; } it also sets something. So this is confusing. It breaks the "do one thing" advice of "Uncle Bob". I would ask you to somehow separate "setting" and "getting", even if it means code getting larger, e.g. because you're setting something first, then getting some result from the object you worked on.
        Hide
        kbashar khyrul bashar added a comment -

        It's really a bad design. I didn't notice earlier.
        I've attached a patch. TreeStatus class is trimmed off, you may give it a look

        Show
        kbashar khyrul bashar added a comment - It's really a bad design. I didn't notice earlier. I've attached a patch. TreeStatus class is trimmed off, you may give it a look
        Show
        tilman Tilman Hausherr added a comment - You may want to read this: https://www.securecoding.cert.org/confluence/display/java/ERR08-J.+Do+not+catch+NullPointerException+or+any+of+its+ancestors
        Hide
        kbashar khyrul bashar added a comment -

        Thank you for the link. It's helpful
        May I upload a new version of the patch?

        Show
        kbashar khyrul bashar added a comment - Thank you for the link. It's helpful May I upload a new version of the patch?
        Hide
        tilman Tilman Hausherr added a comment -

        Sure, you can delete it, add a new one, you can also edit messages or delete them.

        Show
        tilman Tilman Hausherr added a comment - Sure, you can delete it, add a new one, you can also edit messages or delete them.
        Hide
        kbashar khyrul bashar added a comment -

        I've got one bad design, catching null pointer exception which I'm changing now. Is there any I'm not aware of?

        Show
        kbashar khyrul bashar added a comment - I've got one bad design, catching null pointer exception which I'm changing now. Is there any I'm not aware of?
        Hide
        tilman Tilman Hausherr added a comment -

        No, I would have mentioned it. However I didn't apply the patch and look further at the resulting code after I saw the NPE patch. Refactoring is an iterative process... and each time the code gets better. (A few weeks ago I refactored code that I had already refactored a year earlier).

        Show
        tilman Tilman Hausherr added a comment - No, I would have mentioned it. However I didn't apply the patch and look further at the resulting code after I saw the NPE patch. Refactoring is an iterative process... and each time the code gets better. (A few weeks ago I refactored code that I had already refactored a year earlier).
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1682370 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1682370 ]

        PDFBOX-2530: refactoring of tree status code, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1682370 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1682370 ] PDFBOX-2530 : refactoring of tree status code, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Nice refactoring!

        Show
        tilman Tilman Hausherr added a comment - Nice refactoring!
        Hide
        kbashar khyrul bashar added a comment -

        Tree, showing pdf structure in PDFDebugger, is updated to give some context menus depending on the type of node object.
        For all node, there is "Copy tree path" which copies the tree path string in the clipboard which you can later use in TreeStatusPane as input. I hope it will be useful in discussion.
        For stream nodes, some context menus are added to save streams in different format possible i.e saving filtered stream, unfiltered stream, partially filtered stream.

        Show
        kbashar khyrul bashar added a comment - Tree, showing pdf structure in PDFDebugger, is updated to give some context menus depending on the type of node object. For all node, there is "Copy tree path" which copies the tree path string in the clipboard which you can later use in TreeStatusPane as input. I hope it will be useful in discussion. For stream nodes, some context menus are added to save streams in different format possible i.e saving filtered stream, unfiltered stream, partially filtered stream.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1682687 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1682687 ]

        PDFBOX-2530: save streams from context + tree focus, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1682687 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1682687 ] PDFBOX-2530 : save streams from context + tree focus, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks... I had the privilege to use these features in the last few days, and it did already help with debugging PDFs

        I committed with small changes:

        • removed a variable that isn't used (or will it be used in the future?)
        • format differences
        • make fields final

        I noticed that super.approveSelection() is called twice in FileOpenSaveDialog.approveSelection() - is this intended? It doesn't seem to hurt, but I wonder if it is needed.

        More slight changes possibly coming later, after the SonarQube run.

        Show
        tilman Tilman Hausherr added a comment - Thanks... I had the privilege to use these features in the last few days, and it did already help with debugging PDFs I committed with small changes: removed a variable that isn't used (or will it be used in the future?) format differences make fields final I noticed that super.approveSelection() is called twice in FileOpenSaveDialog.approveSelection() - is this intended? It doesn't seem to hurt, but I wonder if it is needed. More slight changes possibly coming later, after the SonarQube run.
        Hide
        kbashar khyrul bashar added a comment - - edited

        re super.approveSelection():
        yes, it is intended. JFileChooser#approveSelection() is called in both cases i.e. open file dialog, save file dialog. And we Override the behaviour slightly only for save file dialog and after showing warning we return to the super.
        BTW by refactoring more I see we can actually modify the code that has only one super.approveSelection(). But that's not an issue for now I think

        Show
        kbashar khyrul bashar added a comment - - edited re super.approveSelection(): yes, it is intended. JFileChooser#approveSelection() is called in both cases i.e. open file dialog, save file dialog. And we Override the behaviour slightly only for save file dialog and after showing warning we return to the super. BTW by refactoring more I see we can actually modify the code that has only one super.approveSelection(). But that's not an issue for now I think
        Hide
        tilman Tilman Hausherr added a comment -

        Oops I see there's a bug: when answering "no", the file is overwritten anyway.

        Show
        tilman Tilman Hausherr added a comment - Oops I see there's a bug: when answering "no", the file is overwritten anyway.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1682696 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1682696 ]

        PDFBOX-2530: fix bug that caused file to be overwritten

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1682696 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1682696 ] PDFBOX-2530 : fix bug that caused file to be overwritten
        Hide
        tilman Tilman Hausherr added a comment - - edited

        I fixed it... hopefully it is similar to what you had in mind anyway, for refactoring.

        Show
        tilman Tilman Hausherr added a comment - - edited I fixed it... hopefully it is similar to what you had in mind anyway, for refactoring.
        Hide
        kbashar khyrul bashar added a comment -

        yes, it is.
        Thanks

        Show
        kbashar khyrul bashar added a comment - yes, it is. Thanks
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1682717 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1682717 ]

        PDFBOX-2530, PDFBOX-2576: avoid throwing RuntimeException; use List instead of ArrayList when possible; make field private that isn't used outside; close OutputStream on checked exception

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1682717 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1682717 ] PDFBOX-2530 , PDFBOX-2576 : avoid throwing RuntimeException; use List instead of ArrayList when possible; make field private that isn't used outside; close OutputStream on checked exception
        Hide
        tilman Tilman Hausherr added a comment -

        I fixed some of the SonarQube complaints. I didn't fix

        • printStackTrace() because these are used at other places too, some better solution should be found independently of the GSoC2015 project, e.g. a log window like in MediathekView, or an error dialog box with optional stack trace display like in TVBrowser
        • the alleged package cycles, this can be done at a later time (and it is very tricky, too!)
        Show
        tilman Tilman Hausherr added a comment - I fixed some of the SonarQube complaints. I didn't fix printStackTrace() because these are used at other places too, some better solution should be found independently of the GSoC2015 project, e.g. a log window like in MediathekView , or an error dialog box with optional stack trace display like in TVBrowser the alleged package cycles, this can be done at a later time (and it is very tricky, too!)
        Hide
        kbashar khyrul bashar added a comment -

        Special color space showing feature. Though this is only for Separation color space.
        When an array containing separation color space is clicked a panel in right side show a visual representation of it.

        Show
        kbashar khyrul bashar added a comment - Special color space showing feature. Though this is only for Separation color space. When an array containing separation color space is clicked a panel in right side show a visual representation of it.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1684038 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1684038 ]

        PDFBOX-2530: show separation colorspace in pane, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1684038 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1684038 ] PDFBOX-2530 : show separation colorspace in pane, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks, I committed this with minor changes.

        If anyone wants to see the magic, get the file gs-bugzilla692845.pdf (see PDFBOX-2363) and go to Root/Pages/Kids/[0]/Resources/ColorSpace/CS10.

        Show
        tilman Tilman Hausherr added a comment - Thanks, I committed this with minor changes. If anyone wants to see the magic, get the file gs-bugzilla692845.pdf (see PDFBOX-2363 ) and go to Root/Pages/Kids/ [0] /Resources/ColorSpace/CS10 .
        Hide
        msahyoun Maruan Sahyoun added a comment -

        I gave it a quick try - very nice. For the UI I'll add a screenshot from Adobe Brackets as a suggestion (not to be copied 1:1). Don't know if that's feasible and definitely can be worked on much later so shouldn't distract from adding new enhancements.

        Show
        msahyoun Maruan Sahyoun added a comment - I gave it a quick try - very nice. For the UI I'll add a screenshot from Adobe Brackets as a suggestion (not to be copied 1:1). Don't know if that's feasible and definitely can be worked on much later so shouldn't distract from adding new enhancements.
        Hide
        msahyoun Maruan Sahyoun added a comment -

        Brackets color chooser UI

        Show
        msahyoun Maruan Sahyoun added a comment - Brackets color chooser UI
        Hide
        tilman Tilman Hausherr added a comment -

        Don't know either, it looks very complex. What's currently being done is to display what colors were really available in a colorspace, so that all this becomes less mysterious. The problem in the past was that lots of searching and calculating and trying needed to be done to understand (unless of course people already have an Adobe product ). Coming next is DeviceN and Indexed.

        Show
        tilman Tilman Hausherr added a comment - Don't know either, it looks very complex. What's currently being done is to display what colors were really available in a colorspace, so that all this becomes less mysterious. The problem in the past was that lots of searching and calculating and trying needed to be done to understand (unless of course people already have an Adobe product ). Coming next is DeviceN and Indexed.
        Hide
        msahyoun Maruan Sahyoun added a comment -

        I thought about the enhanced UI as the current one already allows to change values so it's not display only.

        Show
        msahyoun Maruan Sahyoun added a comment - I thought about the enhanced UI as the current one already allows to change values so it's not display only.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1684227 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1684227 ]

        PDFBOX-2530: use set instead of list, make private static final

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1684227 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1684227 ] PDFBOX-2530 : use set instead of list, make private static final
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1684229 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1684229 ]

        PDFBOX-2530: use available constant

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1684229 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1684229 ] PDFBOX-2530 : use available constant
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1684901 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1684901 ]

        PDFBOX-2576, PDFBOX-2530: remove reference to PDFDebugger and use awt base class instead; call to default constructor is implicit

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1684901 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1684901 ] PDFBOX-2576 , PDFBOX-2530 : remove reference to PDFDebugger and use awt base class instead; call to default constructor is implicit
        Hide
        kbashar khyrul bashar added a comment -

        DeviceN color space showing feature.
        In a table colorant names are shown with maximum and minimum values using colorbar.

        Show
        kbashar khyrul bashar added a comment - DeviceN color space showing feature. In a table colorant names are shown with maximum and minimum values using colorbar.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1684918 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1684918 ]

        PDFBOX-2530: show DeviceN colorspace in pane, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1684918 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1684918 ] PDFBOX-2530 : show DeviceN colorspace in pane, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks!

        The magic can be seen at Root/Pages/Kids/[0]/Resources/ColorSpace/CS49 in gs-bugzilla692845.pdf.

        Show
        tilman Tilman Hausherr added a comment - Thanks! The magic can be seen at Root/Pages/Kids/ [0] /Resources/ColorSpace/CS49 in gs-bugzilla692845.pdf.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685164 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685164 ]

        PDFBOX-2530: avoid throwing RuntimeException, IOException is caught later anyway

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685164 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685164 ] PDFBOX-2530 : avoid throwing RuntimeException, IOException is caught later anyway
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685236 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685236 ]

        PDFBOX-2530: avoid "overridable method inc constructor" warning and remove method that is never used

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685236 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685236 ] PDFBOX-2530 : avoid "overridable method inc constructor" warning and remove method that is never used
        Hide
        kbashar khyrul bashar added a comment -

        "Showing Indexed Colorspace" feature.

        Show
        kbashar khyrul bashar added a comment - "Showing Indexed Colorspace" feature.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685500 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685500 ]

        PDFBOX-2530: show Indexed colorspace + show colorspace title, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685500 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685500 ] PDFBOX-2530 : show Indexed colorspace + show colorspace title, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks! The magic can be seen in the file Basiswissen-Vorschriften.pdf, e.g. in Root/Pages/Kids/[5]/Resources/ColorSpace/Cs76.

        Show
        tilman Tilman Hausherr added a comment - Thanks! The magic can be seen in the file Basiswissen-Vorschriften.pdf, e.g. in Root/Pages/Kids/ [5] /Resources/ColorSpace/Cs76 .
        Hide
        msahyoun Maruan Sahyoun added a comment -

        very nice!

        A minor issue when navigating entering the 'address' the position in the tree view doesn't change and the element is not selected so entering the above address won't show anything immediately but one has to click on the element again.

        Show
        msahyoun Maruan Sahyoun added a comment - very nice! A minor issue when navigating entering the 'address' the position in the tree view doesn't change and the element is not selected so entering the above address won't show anything immediately but one has to click on the element again.
        Hide
        tilman Tilman Hausherr added a comment -

        For me the left part does change and has the keyboard focus, but I can reproduce that the stuff in the right pane isn't initialized when an address is entered.

        Show
        tilman Tilman Hausherr added a comment - For me the left part does change and has the keyboard focus, but I can reproduce that the stuff in the right pane isn't initialized when an address is entered.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685617 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685617 ]

        PDFBOX-2530: use constants

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685617 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685617 ] PDFBOX-2530 : use constants
        Hide
        kbashar khyrul bashar added a comment -

        Selecting tree node by inputting tree string wasn't showing the contents in the rightpane. The patch is to overcome this.

        Show
        kbashar khyrul bashar added a comment - Selecting tree node by inputting tree string wasn't showing the contents in the rightpane. The patch is to overcome this.
        Hide
        kbashar khyrul bashar added a comment -

        I've submitted a patch to resolve this.
        It was happening because when we are using Tree string to select it's building a treepath instance of which last component is a COSObject(COSArray is it's BaseObject) but for regular selection we directly get COSArray. Here COSArray decides what to show in the right pane. So for treestring, selection was working but displaying wasn't.

        Show
        kbashar khyrul bashar added a comment - I've submitted a patch to resolve this. It was happening because when we are using Tree string to select it's building a treepath instance of which last component is a COSObject(COSArray is it's BaseObject) but for regular selection we directly get COSArray. Here COSArray decides what to show in the right pane. So for treestring, selection was working but displaying wasn't.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685649 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685649 ]

        PDFBOX-2530: dereference COSObject after url select, as done by Khyrul Bashar in GSoC2015; display "other" colorspace names in right pane; display page number in right pane

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685649 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685649 ] PDFBOX-2530 : dereference COSObject after url select, as done by Khyrul Bashar in GSoC2015; display "other" colorspace names in right pane; display page number in right pane
        Hide
        tilman Tilman Hausherr added a comment - - edited

        khyrul bashar I committed your fix.

        I also committed a change I was working on, displaying "something" for the colorspaces that don't have any "magic" in them. The problem is that these colorspaces would just have an empty right pane. And then I thought I'd also display the page number for pages. At a later time, I'd try to display a page rendering.

        I'm aware that there is now a lot of double code. The MapEntry / ArrayEntry stuff is there several times, and the colorspace gui stuff might use a common base class. I'll think about it. Locally, I'm already using a base class for MapEntry / ArrayEntry which I have named "EntryValue", but I'm not sure if the name is good.

        Show
        tilman Tilman Hausherr added a comment - - edited khyrul bashar I committed your fix. I also committed a change I was working on, displaying "something" for the colorspaces that don't have any "magic" in them. The problem is that these colorspaces would just have an empty right pane. And then I thought I'd also display the page number for pages. At a later time, I'd try to display a page rendering. I'm aware that there is now a lot of double code. The MapEntry / ArrayEntry stuff is there several times, and the colorspace gui stuff might use a common base class. I'll think about it. Locally, I'm already using a base class for MapEntry / ArrayEntry which I have named "EntryValue", but I'm not sure if the name is good.
        Hide
        jahewson John Hewson added a comment -

        These color space viewing features are great. It would make more sense, however, to display the entire color space for a Separation as a linear gradient, rather than just a single data point with a slider. The same is true of DeviceN, perhaps add a column between Maximum and Minimum which shows the entire range of the colorant as a linear gradient.

        One issue too: the "Minimum" amount of colorant should never result in black (unless you're printing on black paper), so there's something wrong there.

        Show
        jahewson John Hewson added a comment - These color space viewing features are great. It would make more sense, however, to display the entire color space for a Separation as a linear gradient, rather than just a single data point with a slider. The same is true of DeviceN, perhaps add a column between Maximum and Minimum which shows the entire range of the colorant as a linear gradient. One issue too: the "Minimum" amount of colorant should never result in black (unless you're printing on black paper), so there's something wrong there.
        Hide
        tilman Tilman Hausherr added a comment - - edited

        The gui of the two features was agreed in the proposal. I like to treat this as a contract. Now even if both parties agree, there is the risk that the extra work results in other work not being done. (I did have an extra idea about the DeviceN pane and kept it for myself for now, because it is really more important that all the work is being done first). There are still a lots of topics that need to be done. We can still do more "improving" of the features at a later time, but the most important is that the users now can see what the colors are really about.

        About the minimum values - maybe, maybe not. I think I remember that effect in the DeviceN colors of the ch14.pdf file, although I'm not 100% sure.

        Show
        tilman Tilman Hausherr added a comment - - edited The gui of the two features was agreed in the proposal. I like to treat this as a contract. Now even if both parties agree, there is the risk that the extra work results in other work not being done. (I did have an extra idea about the DeviceN pane and kept it for myself for now, because it is really more important that all the work is being done first). There are still a lots of topics that need to be done. We can still do more "improving" of the features at a later time, but the most important is that the users now can see what the colors are really about. About the minimum values - maybe, maybe not. I think I remember that effect in the DeviceN colors of the ch14.pdf file, although I'm not 100% sure.
        Hide
        tilman Tilman Hausherr added a comment -

        khyrul bashar John is right about the DeviceN problem, I just looked at the ch14.pdf file. You can get it here:
        http://www.math.ubc.ca/~cass/graphics/manual/pdf/ch14.pdf
        Look at the first page, at the 3d sphere. There is some white in it, but PDFDebugger displays both colors between red and black, see at Root/Pages/Kids/[0]/Resources/ColorSpace/R17.

        Show
        tilman Tilman Hausherr added a comment - khyrul bashar John is right about the DeviceN problem, I just looked at the ch14.pdf file. You can get it here: http://www.math.ubc.ca/~cass/graphics/manual/pdf/ch14.pdf Look at the first page, at the 3d sphere. There is some white in it, but PDFDebugger displays both colors between red and black, see at Root/Pages/Kids/ [0] /Resources/ColorSpace/R17 .
        Hide
        tilman Tilman Hausherr added a comment -

        I looked at the code again... IMHO there is one single char to change: in CSDeviceN.java change
        Arrays.fill(minimum, 1); to Arrays.fill(minimum, 0);

        Show
        tilman Tilman Hausherr added a comment - I looked at the code again... IMHO there is one single char to change: in CSDeviceN.java change Arrays.fill(minimum, 1); to Arrays.fill(minimum, 0);
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685670 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685670 ]

        PDFBOX-2530: only one colorant at maximum

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685670 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685670 ] PDFBOX-2530 : only one colorant at maximum
        Hide
        tilman Tilman Hausherr added a comment -

        I committed the above change immediately after a look at the file PDFBOX-1870-DeviceN3.pdf - it has these operations in the content stream:

        1 0 0 0 0 0 scn
        ...
        0 1 0 0 0 0 scn
        ...
        0 0 1 0 0 0 scn
        ...
        

        so it is really only one colorant that is to be maximum.

        Show
        tilman Tilman Hausherr added a comment - I committed the above change immediately after a look at the file PDFBOX-1870 -DeviceN3.pdf - it has these operations in the content stream: 1 0 0 0 0 0 scn ... 0 1 0 0 0 0 scn ... 0 0 1 0 0 0 scn ... so it is really only one colorant that is to be maximum.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685672 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685672 ]

        PDFBOX-2530: remove code line that isn't needed anymore

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685672 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685672 ] PDFBOX-2530 : remove code line that isn't needed anymore
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685765 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685765 ]

        PDFBOX-2530: fix wrong instanceof

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685765 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685765 ] PDFBOX-2530 : fix wrong instanceof
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685795 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685795 ]

        PDFBOX-2530: fix IndexOutOfBoundsException for empty COSArray

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685795 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685795 ] PDFBOX-2530 : fix IndexOutOfBoundsException for empty COSArray
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685810 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685810 ]

        PDFBOX-2530: render page in page pane

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685810 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685810 ] PDFBOX-2530 : render page in page pane
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685837 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685837 ]

        PDFBOX-2530: show a wait cursor while rendering

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685837 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685837 ] PDFBOX-2530 : show a wait cursor while rendering
        Hide
        jahewson John Hewson added a comment - - edited

        Looks good! The colors are now what I would expect. It would make sense to remove the "Minimum" column from DeviceN though, because zero colorant is always going to be white.

        Show
        jahewson John Hewson added a comment - - edited Looks good! The colors are now what I would expect. It would make sense to remove the "Minimum" column from DeviceN though, because zero colorant is always going to be white.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1685911 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1685911 ]

        PDFBOX-2530: Replace PDFPagePanel with PDFRenderer and SwingWorker

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1685911 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1685911 ] PDFBOX-2530 : Replace PDFPagePanel with PDFRenderer and SwingWorker
        Hide
        jahewson John Hewson added a comment -

        Tilman, your page rendering is a really cool feature, however rendering on the UI thread slows PDFDebugger down to a crawl and makes rapid navigation of the pages and resizing the window almost impossible. There's no real need for PDFPagePanel so I simply replaced it with a JLabel and render the page image in a background thread using PDFRenderer. This prevents the UI from locking up when navigating through pages and allows smooth window resize. I also added a JScrollPane so that the page can be scrolled when it's larger than the window.

        Note that technically I'm using PDDocument from multiple threads, which isn't safe. But as far as I can tell, rendering doesn't involve any write operations, so we should be safe. That's good enough for PDFDebugger.

        Show
        jahewson John Hewson added a comment - Tilman, your page rendering is a really cool feature, however rendering on the UI thread slows PDFDebugger down to a crawl and makes rapid navigation of the pages and resizing the window almost impossible. There's no real need for PDFPagePanel so I simply replaced it with a JLabel and render the page image in a background thread using PDFRenderer. This prevents the UI from locking up when navigating through pages and allows smooth window resize. I also added a JScrollPane so that the page can be scrolled when it's larger than the window. Note that technically I'm using PDDocument from multiple threads, which isn't safe. But as far as I can tell, rendering doesn't involve any write operations, so we should be safe. That's good enough for PDFDebugger.
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks!

        Show
        tilman Tilman Hausherr added a comment - Thanks!
        Hide
        tilman Tilman Hausherr added a comment -

        Yes, in theory this should be so, when thinking about the physical world. However what is displayed on the right is a color calculated from a color set (0 ... 0). That one could be non white if there is an error in the function that calculates the actual display color. There are people who do write their function themselves, we had such a guy on the mailing list once.

        Of course the perfect idea would be something like with the separation color, but with n sliders and also the result color, however - see my comment from 2 days ago about improving features later. We're "in time" currently, but the upcoming features may be quite difficult.

        Show
        tilman Tilman Hausherr added a comment - Yes, in theory this should be so, when thinking about the physical world. However what is displayed on the right is a color calculated from a color set (0 ... 0). That one could be non white if there is an error in the function that calculates the actual display color. There are people who do write their function themselves, we had such a guy on the mailing list once. Of course the perfect idea would be something like with the separation color, but with n sliders and also the result color, however - see my comment from 2 days ago about improving features later. We're "in time" currently, but the upcoming features may be quite difficult.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1686057 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1686057 ]

        PDFBOX-2530: narrow exception

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1686057 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1686057 ] PDFBOX-2530 : narrow exception
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1686058 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1686058 ]

        PDFBOX-2530: fix imports

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1686058 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1686058 ] PDFBOX-2530 : fix imports
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1686061 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1686061 ]

        PDFBOX-2530: adjust javadoc

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1686061 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1686061 ] PDFBOX-2530 : adjust javadoc
        Hide
        jahewson John Hewson added a comment -

        That's a good point, a bad function could result in a non-white minimum value, which is something we'd want to know about in PDFDebugger. Agreed that plotting the full range would be perfect but what we have now is more than adequate - really useful, in fact.

        Show
        jahewson John Hewson added a comment - That's a good point, a bad function could result in a non-white minimum value, which is something we'd want to know about in PDFDebugger. Agreed that plotting the full range would be perfect but what we have now is more than adequate - really useful, in fact.
        Hide
        kbashar khyrul bashar added a comment -

        Some redundant code regarding COSBase instance acquiring from MapEntry or ArrayEntry is removed.

        Show
        kbashar khyrul bashar added a comment - Some redundant code regarding COSBase instance acquiring from MapEntry or ArrayEntry is removed.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1686459 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1686459 ]

        PDFBOX-2530: DRY refactoring, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1686459 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1686459 ] PDFBOX-2530 : DRY refactoring, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Committed as is except for one line you probably accidentally reverted, which was about preventing an exception for empty COSArrays. Your change should fix many recent SonarQube issues

        Show
        tilman Tilman Hausherr added a comment - Committed as is except for one line you probably accidentally reverted, which was about preventing an exception for empty COSArrays. Your change should fix many recent SonarQube issues
        Hide
        kbashar khyrul bashar added a comment -

        Clicking parent node in the tree the user fall in a never ending loop.
        I've written a patch when a parent keyed node in the tree is clicked the user will be redirected to the parent Node it represents.
        Anyway, parent node is yet expandable. should I make it unexpandable or just keep it as it is?

        Show
        kbashar khyrul bashar added a comment - Clicking parent node in the tree the user fall in a never ending loop. I've written a patch when a parent keyed node in the tree is clicked the user will be redirected to the parent Node it represents. Anyway, parent node is yet expandable. should I make it unexpandable or just keep it as it is?
        Hide
        tilman Tilman Hausherr added a comment -

        Before committing this one, I'd like to have the opinion of others here, also about whether the "jump" it should be made configurable.

        khyrul bashar please create your patch again, something went wrong, there's an e-mail header. It is of course still possible to grasp the changes, but it would be more work.

        Show
        tilman Tilman Hausherr added a comment - Before committing this one, I'd like to have the opinion of others here, also about whether the "jump" it should be made configurable. khyrul bashar please create your patch again, something went wrong, there's an e-mail header. It is of course still possible to grasp the changes, but it would be more work.
        Hide
        kbashar khyrul bashar added a comment -

        I've updated the patch.

        Show
        kbashar khyrul bashar added a comment - I've updated the patch.
        Hide
        kbashar khyrul bashar added a comment -

        Just to help evaluate the possibilities I've added another patch that disables expanding.

        Show
        kbashar khyrul bashar added a comment - Just to help evaluate the possibilities I've added another patch that disables expanding.
        Hide
        jahewson John Hewson added a comment - - edited

        The "jump" makes the tree view unusable with a keyboard (which is the only way I use it) and breaks the notion of what it means to select a tree node - when I click on a node, I don't want to jump elsewhere in the tree. PDFs contain many indirect objects, so I don't see what makes Parent objects special which merits this behaviour. Conceptually if both the parent itself and child reference to it are indirect, then neither of these entries represents the "actual" object, they're equal, and both deserve to be treated identically. Expanding indirect objects inline is exactly the behaviour I expect and find useful, jumping elsewhere is an unpleasant surprise.

        It's good to experiment with these things but this patch introduces too much weird behaviour. We can keep it around for future reference, but it's probably best to move on to the next task. It was a worthy experiment nonetheless, so thank you.

        Show
        jahewson John Hewson added a comment - - edited The "jump" makes the tree view unusable with a keyboard (which is the only way I use it) and breaks the notion of what it means to select a tree node - when I click on a node, I don't want to jump elsewhere in the tree. PDFs contain many indirect objects, so I don't see what makes Parent objects special which merits this behaviour. Conceptually if both the parent itself and child reference to it are indirect, then neither of these entries represents the "actual" object, they're equal, and both deserve to be treated identically. Expanding indirect objects inline is exactly the behaviour I expect and find useful, jumping elsewhere is an unpleasant surprise. It's good to experiment with these things but this patch introduces too much weird behaviour. We can keep it around for future reference, but it's probably best to move on to the next task. It was a worthy experiment nonetheless, so thank you.
        Hide
        tilman Tilman Hausherr added a comment -

        I agree with that one. I use the keyboard mostly, too.

        Show
        tilman Tilman Hausherr added a comment - I agree with that one. I use the keyboard mostly, too.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1686918 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1686918 ]

        PDFBOX-2530: Set menu bar appearance hints for OS X

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1686918 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1686918 ] PDFBOX-2530 : Set menu bar appearance hints for OS X
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1686942 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1686942 ]

        PDFBOX-2530: Display unprintable strings as hex

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1686942 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1686942 ] PDFBOX-2530 : Display unprintable strings as hex
        Hide
        jahewson John Hewson added a comment -

        This lets binary strings such as "ID" and "Panose" be viewed.

        Show
        jahewson John Hewson added a comment - This lets binary strings such as "ID" and "Panose" be viewed.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1686943 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1686943 ]

        PDFBOX-2530: fix IndexOutOfBoundsException for empty COSArray

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1686943 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1686943 ] PDFBOX-2530 : fix IndexOutOfBoundsException for empty COSArray
        Hide
        tilman Tilman Hausherr added a comment -

        Can you tell a file where one can see the difference?

        Btw that change is part of the GSoC project, see 1st and 2nd elements. No need to revert, but please look at the list on top or on the proposal first. Your change may be temporary anyway, because the debugger now shows something that isn't the actual content, this can be misleading. The intention of the project is to allow several views, like in a hex editor. (However I see now that the proposal has a misunderstanding there which I missed, however it shouldn't bring more work)

        khyrul bashar The misunderstanding is that the hex view etc is not about "the PDF file", it is about strings and streams.

        Show
        tilman Tilman Hausherr added a comment - Can you tell a file where one can see the difference? Btw that change is part of the GSoC project, see 1st and 2nd elements. No need to revert, but please look at the list on top or on the proposal first. Your change may be temporary anyway, because the debugger now shows something that isn't the actual content, this can be misleading. The intention of the project is to allow several views, like in a hex editor. (However I see now that the proposal has a misunderstanding there which I missed, however it shouldn't bring more work) khyrul bashar The misunderstanding is that the hex view etc is not about "the PDF file", it is about strings and streams.
        Hide
        jahewson John Hewson added a comment -

        So it is, sorry I'd missed that it was a GSoC item - I was working on Panose strings today and wanted to view them. You can see the difference in any file with an ID entry, e.g. PDFBOX-2660. I agree that the hex string content could be misleading, notably Acrobat Pro's preflight displays unprintable strings in the same manner but they use icons in the tree view to indicate the type of the value (e.g. "Aa" vs "0x").

        I'd rather see a hex view in the debugger pane too, which is an upcoming GSoc item, so that's great. My implementation of that view content is basically a quick hack.

        Show
        jahewson John Hewson added a comment - So it is, sorry I'd missed that it was a GSoC item - I was working on Panose strings today and wanted to view them. You can see the difference in any file with an ID entry, e.g. PDFBOX-2660 . I agree that the hex string content could be misleading, notably Acrobat Pro's preflight displays unprintable strings in the same manner but they use icons in the tree view to indicate the type of the value (e.g. "Aa" vs "0x"). I'd rather see a hex view in the debugger pane too, which is an upcoming GSoc item, so that's great. My implementation of that view content is basically a quick hack.
        Hide
        jahewson John Hewson added a comment -

        Hmm, turns out this doesn't handle the case where the string isn't human-readable but happens to contain only printable characters. Instead of detecting unprintable characters it might be better to simply use a list of keys which are known to contain binary string values (there aren't that many).

        Show
        jahewson John Hewson added a comment - Hmm, turns out this doesn't handle the case where the string isn't human-readable but happens to contain only printable characters. Instead of detecting unprintable characters it might be better to simply use a list of keys which are known to contain binary string values (there aren't that many).
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687147 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687147 ]

        PDFBOX-2530: Added custom tree icons and labels

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687147 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687147 ] PDFBOX-2530 : Added custom tree icons and labels
        Hide
        jahewson John Hewson added a comment -

        I replaced the default tree icons with some inspired by Acrobat Pro's preflight tool, as mentioned above. The icons were made from scratch using Photoshop. I've also added the object id/gen information which Acrobat Pro shows in its tree too. Things are really shaping up nicely.

        Show
        jahewson John Hewson added a comment - I replaced the default tree icons with some inspired by Acrobat Pro's preflight tool , as mentioned above. The icons were made from scratch using Photoshop. I've also added the object id/gen information which Acrobat Pro shows in its tree too. Things are really shaping up nicely.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687149 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687149 ]

        PDFBOX-2530: Bugfix: tree should have focus on window open

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687149 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687149 ] PDFBOX-2530 : Bugfix: tree should have focus on window open
        Hide
        kbashar khyrul bashar added a comment -

        I'm getting an NPE. It's may be because there is no "null" named png in resources. Anyway commenting out that part I've run it, It's great!

        Show
        kbashar khyrul bashar added a comment - I'm getting an NPE. It's may be because there is no "null" named png in resources. Anyway commenting out that part I've run it, It's great!
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687326 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687326 ]

        PDFBOX-2530: temporary disable of null icon because of NPE

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687326 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687326 ] PDFBOX-2530 : temporary disable of null icon because of NPE
        Hide
        tilman Tilman Hausherr added a comment - - edited

        This is really nice. However I hope we won't get in legal trouble for having a GUI similar to another product. Or face their anger. (They've been very helpful to us in the past)

        Can we move the OverlayIcon class elsewhere, e.g. into the PDFTreeCellRenderer class? SonarQube complains about a package cycle (the only one in the tools subproject). The OverlayIcon class is used only in PDFTreeCellRenderer.

        Show
        tilman Tilman Hausherr added a comment - - edited This is really nice. However I hope we won't get in legal trouble for having a GUI similar to another product. Or face their anger. (They've been very helpful to us in the past) Can we move the OverlayIcon class elsewhere, e.g. into the PDFTreeCellRenderer class? SonarQube complains about a package cycle (the only one in the tools subproject). The OverlayIcon class is used only in PDFTreeCellRenderer.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687335 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687335 ]

        PDFBOX-2530: move block up and shorten to keep similar blocks together

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687335 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687335 ] PDFBOX-2530 : move block up and shorten to keep similar blocks together
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687336 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687336 ]

        PDFBOX-2530: remove unneeded cast, simplify

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687336 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687336 ] PDFBOX-2530 : remove unneeded cast, simplify
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687337 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687337 ]

        PDFBOX-2530: make constants static

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687337 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687337 ] PDFBOX-2530 : make constants static
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687385 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687385 ]

        PDFBOX-2530: Friendliness towards OS X

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687385 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687385 ] PDFBOX-2530 : Friendliness towards OS X
        Hide
        jahewson John Hewson added a comment -

        This patch allows drag and drop file opening on OS X and follows UI conventions for Open/Recent Files/Quit/etc.

        Show
        jahewson John Hewson added a comment - This patch allows drag and drop file opening on OS X and follows UI conventions for Open/Recent Files/Quit/etc.
        Hide
        jahewson John Hewson added a comment -

        Yes, I'll move the OverlayIcon class to a better location.

        Show
        jahewson John Hewson added a comment - Yes, I'll move the OverlayIcon class to a better location.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687387 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687387 ]

        PDFBOX-2530: Move OverlayIcon to appease Sonar

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687387 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687387 ] PDFBOX-2530 : Move OverlayIcon to appease Sonar
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687388 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687388 ]

        PDFBOX-2530: Add missing null icon

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687388 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687388 ] PDFBOX-2530 : Add missing null icon
        Hide
        tilman Tilman Hausherr added a comment -

        This doesn't work on windows... these three imports don't work:

        import com.apple.eawt.AppEvent;
        import com.apple.eawt.Application;
        import com.apple.eawt.OpenFilesHandler;
        

        Could it be that these classes only exist on a mac JDK?

        Show
        tilman Tilman Hausherr added a comment - This doesn't work on windows... these three imports don't work: import com.apple.eawt.AppEvent; import com.apple.eawt.Application; import com.apple.eawt.OpenFilesHandler; Could it be that these classes only exist on a mac JDK?
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687392 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687392 ]

        PDFBOX-2530: Support COSBoolean in tree

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687392 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687392 ] PDFBOX-2530 : Support COSBoolean in tree
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687396 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687396 ]

        PDFBOX-2530: Refine the integer and real icons

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687396 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687396 ] PDFBOX-2530 : Refine the integer and real icons
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687397 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687397 ]

        PDFBOX-2530: Handle uncaught exceptions

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687397 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687397 ] PDFBOX-2530 : Handle uncaught exceptions
        Hide
        kbashar khyrul bashar added a comment -

        I've the same problem in Ubuntu.

        Show
        kbashar khyrul bashar added a comment - I've the same problem in Ubuntu.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687407 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687407 ]

        PDFBOX-2530: Allow tree to be viewed as pages

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687407 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687407 ] PDFBOX-2530 : Allow tree to be viewed as pages
        Hide
        jahewson John Hewson added a comment - - edited

        This replicates the behaviour found in Acrobat Pro preflight where the PDF's internal structure can be viewed in its raw form or by using pages as the tree nodes. I haven't managed to get setSelectionPath working in my new mode yet.

        You can access the new mode via View > Show Pages

        Show
        jahewson John Hewson added a comment - - edited This replicates the behaviour found in Acrobat Pro preflight where the PDF's internal structure can be viewed in its raw form or by using pages as the tree nodes. I haven't managed to get setSelectionPath working in my new mode yet. You can access the new mode via View > Show Pages
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687414 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687414 ]

        PDFBOX-2530: temporary disable MAC OS only changes that broke the build

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687414 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687414 ] PDFBOX-2530 : temporary disable MAC OS only changes that broke the build
        Hide
        tilman Tilman Hausherr added a comment -

        I've disabled the MAC OS changes for now, as they broke the build, and this would be frustrating for people who try 2.0 for the first time and then wonder why it doesn't work.

        Show
        tilman Tilman Hausherr added a comment - I've disabled the MAC OS changes for now, as they broke the build, and this would be frustrating for people who try 2.0 for the first time and then wonder why it doesn't work.
        Hide
        jahewson John Hewson added a comment -

        Ahh, sorry about that! I guess this is what happens when the build server isn't working. Will take a look now.

        Show
        jahewson John Hewson added a comment - Ahh, sorry about that! I guess this is what happens when the build server isn't working. Will take a look now.
        Hide
        kbashar khyrul bashar added a comment -

        Flags bits are shown in detail. This feature is now implemented for Font, Annotation, and Field flags.

        Show
        kbashar khyrul bashar added a comment - Flags bits are shown in detail. This feature is now implemented for Font, Annotation, and Field flags.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687584 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687584 ]

        PDFBOX-2530: scroll to selected node

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687584 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687584 ] PDFBOX-2530 : scroll to selected node
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687585 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687585 ]

        PDFBOX-2530: treat null like COSNull

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687585 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687585 ] PDFBOX-2530 : treat null like COSNull
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687591 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687591 ]

        PDFBOX-2530: remove public modifier of non public class

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687591 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687591 ] PDFBOX-2530 : remove public modifier of non public class
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687595 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687595 ]

        PDFBOX-2530: Use Apple's cross-platform Java code

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687595 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687595 ] PDFBOX-2530 : Use Apple's cross-platform Java code
        Hide
        jahewson John Hewson added a comment -

        This should fix the issue. I added some open source code from Apple (under a BSD style license), which uses reflection to access the platform-specific JARs.

        Show
        jahewson John Hewson added a comment - This should fix the issue. I added some open source code from Apple (under a BSD style license), which uses reflection to access the platform-specific JARs.
        Hide
        jahewson John Hewson added a comment - - edited

        Awesome, this is super useful. Any chance of getting this for the Panose flags in font descriptor style dictionaries? (The first 2 bytes are actually TTF flags, the last 10 bytes are Panose flags).

        See http://acroeng.adobe.com/Test_Files/fonts/asian%20font%20files/Korean/nonembedded/K4SystemFontsNotEmbeded218.PDF for an example, the tree path is: Root/Pages/Kids/[0]/Resources/Font/F0/DescendantFonts/[0]/FontDescriptor/Style/Panose

        Show
        jahewson John Hewson added a comment - - edited Awesome, this is super useful. Any chance of getting this for the Panose flags in font descriptor style dictionaries? (The first 2 bytes are actually TTF flags, the last 10 bytes are Panose flags). See http://acroeng.adobe.com/Test_Files/fonts/asian%20font%20files/Korean/nonembedded/K4SystemFontsNotEmbeded218.PDF for an example, the tree path is: Root/Pages/Kids/ [0] /Resources/Font/F0/DescendantFonts/ [0] /FontDescriptor/Style/Panose
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687611 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687611 ]

        PDFBOX-2530: show flag bits (Font, Annotation, and Field flags) in a pane, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687611 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687611 ] PDFBOX-2530 : show flag bits (Font, Annotation, and Field flags) in a pane, as done by Khyrul Bashar in GSoC2015
        Hide
        kbashar khyrul bashar added a comment -

        I can't download the file, any other way?

        Show
        kbashar khyrul bashar added a comment - I can't download the file, any other way?
        Hide
        jahewson John Hewson added a comment - - edited

        I've attached it to the this issue for you. Also I added PDFontDescriptor#getPanose() just now, you'll need to do an "svn update" to see it, there are new PDPanose and PDPanoseClassification classes.

        Show
        jahewson John Hewson added a comment - - edited I've attached it to the this issue for you. Also I added PDFontDescriptor#getPanose() just now, you'll need to do an "svn update" to see it, there are new PDPanose and PDPanoseClassification classes.
        Hide
        kbashar khyrul bashar added a comment - - edited

        Panose flags showing feature is implemented as suggested by John Hewson and FlagBitsPane has been redesigned.
        John Hewson please note that I've changed PDPanose access modifier to public. I could have use FontDescriptor way but that would break some uniformity (I'm now using the flag and the parent dictionary but in this case I would have to send parent's parent).
        Anyway, if changing to the public is not affordable I can change the implementation, won't be much work.

        Show
        kbashar khyrul bashar added a comment - - edited Panose flags showing feature is implemented as suggested by John Hewson and FlagBitsPane has been redesigned. John Hewson please note that I've changed PDPanose access modifier to public. I could have use FontDescriptor way but that would break some uniformity (I'm now using the flag and the parent dictionary but in this case I would have to send parent's parent). Anyway, if changing to the public is not affordable I can change the implementation, won't be much work.
        Hide
        tilman Tilman Hausherr added a comment -

        Other files to see it:

        PDFBOX-2435.pdf at Root/Pages/Kids/[0]/Resources/XObject/Xf1/Resources/Font/RL90/DescendantFonts/[0]/FontDescriptor/Style/Panose

        PDFBOX-2711.pdf at Root/AcroForm/DR/Font/KaGo/DescendantFonts/[0]/FontDescriptor/Style/Panose

        Show
        tilman Tilman Hausherr added a comment - Other files to see it: PDFBOX-2435 .pdf at Root/Pages/Kids/ [0] /Resources/XObject/Xf1/Resources/Font/RL90/DescendantFonts/ [0] /FontDescriptor/Style/Panose PDFBOX-2711 .pdf at Root/AcroForm/DR/Font/KaGo/DescendantFonts/ [0] /FontDescriptor/Style/Panose
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687869 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687869 ]

        PDFBOX-2530: set constant all caps

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687869 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687869 ] PDFBOX-2530 : set constant all caps
        Hide
        tilman Tilman Hausherr added a comment -

        The effect can be seen with the file of PDFBOX-2158.pdf, at Root/Pages/Kids/[0]/Resources/XObject/X0/Decode/[15]. The reason is that COSArray.getObject() returns null for COSNull. (Same for COSDictionary.getDictionaryObject())

        Show
        tilman Tilman Hausherr added a comment - The effect can be seen with the file of PDFBOX-2158 .pdf, at Root/Pages/Kids/ [0] /Resources/XObject/X0/Decode/ [15] . The reason is that COSArray.getObject() returns null for COSNull. (Same for COSDictionary.getDictionaryObject())
        Hide
        jahewson John Hewson added a comment -

        Looks good, thanks.

        Show
        jahewson John Hewson added a comment - Looks good, thanks.
        Hide
        kbashar khyrul bashar added a comment -

        Panose flag showing feature and flagbitspane redesigned.

        Show
        kbashar khyrul bashar added a comment - Panose flag showing feature and flagbitspane redesigned.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1687901 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1687901 ]

        PDFBOX-2530: show more flag bits (Panose) in a pane + refactoring, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1687901 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1687901 ] PDFBOX-2530 : show more flag bits (Panose) in a pane + refactoring, as done by Khyrul Bashar in GSoC2015
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1688016 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1688016 ]

        PDFBOX-2530: fix SonarQube issues, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1688016 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1688016 ] PDFBOX-2530 : fix SonarQube issues, as done by Khyrul Bashar in GSoC2015
        Hide
        jahewson John Hewson added a comment -

        Awesome, thanks guys. I think I'm going to write some new font mapping code using Panose soon.

        Show
        jahewson John Hewson added a comment - Awesome, thanks guys. I think I'm going to write some new font mapping code using Panose soon.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1688254 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1688254 ]

        PDFBOX-2530: don't dereference for COSArray

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1688254 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1688254 ] PDFBOX-2530 : don't dereference for COSArray
        Hide
        tilman Tilman Hausherr added a comment -

        This commit fixes a problem with /OpenAction in the file PDFBOX-142-acroform.pdf, at Root/OpenAction/[0]. This is an object reference, but it was displayed without the superimposed arrow.

        Show
        tilman Tilman Hausherr added a comment - This commit fixes a problem with /OpenAction in the file PDFBOX-142 -acroform.pdf, at Root/OpenAction/ [0] . This is an object reference, but it was displayed without the superimposed arrow.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1688502 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1688502 ]

        PDFBOX-2530: fix typo

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1688502 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1688502 ] PDFBOX-2530 : fix typo
        Hide
        tilman Tilman Hausherr added a comment -

        John Hewson why do streams not get the "indirect" overlay icon? I know that streams are always indirect objects, but not having the "indirect" overlay icon feels weird.

        Show
        tilman Tilman Hausherr added a comment - John Hewson why do streams not get the "indirect" overlay icon? I know that streams are always indirect objects, but not having the "indirect" overlay icon feels weird.
        Hide
        jahewson John Hewson added a comment -

        Yep, that's why. Acrobat Pro does it that way.

        Show
        jahewson John Hewson added a comment - Yep, that's why. Acrobat Pro does it that way.
        Hide
        tilman Tilman Hausherr added a comment -

        khyrul bashar There's an NPE with the file from PDFBOX-2849, when going to Root/AcroForm/Fields/[0]/Kids/[1]/Kids/[2]/Kids/[1]/Ff.

        It is happening in FieldFlag.getFlagType(). The code there is risky and I missed that in review (and so did Netbeans and SonarQube)

        Instead of this

        if (dictionary.getCOSName(COSName.FT).equals(COSName.TX))
        

        please use this:

        if (COSName.TX.equals(dictionary.getCOSName(COSName.FT)))
        

        The line in the current code will go NPE if dictionary.getCOSName(COSName.FT) == null. The same problem is also in getFlagBits(). And you might want to refactor this to evaluate dictionary.getCOSName(COSName.FT) only once in a method.

        (The modified code still brings an NPE later, maybe because FlagBitsPaneView can't handle null parameters)

        Maruan Sahyoun is this correct that the 4 widgets do not have an /FT entry? My understanding is that they are also terminal fields and that the field and widget entries are merged. The question is whether PDFDebugger should look upwards for the type, or just ignore the /Ff there.

        Show
        tilman Tilman Hausherr added a comment - khyrul bashar There's an NPE with the file from PDFBOX-2849 , when going to Root/AcroForm/Fields/[0]/Kids/[1]/Kids/[2]/Kids/[1]/Ff . It is happening in FieldFlag.getFlagType(). The code there is risky and I missed that in review (and so did Netbeans and SonarQube) Instead of this if (dictionary.getCOSName(COSName.FT).equals(COSName.TX)) please use this: if (COSName.TX.equals(dictionary.getCOSName(COSName.FT))) The line in the current code will go NPE if dictionary.getCOSName(COSName.FT) == null. The same problem is also in getFlagBits(). And you might want to refactor this to evaluate dictionary.getCOSName(COSName.FT) only once in a method. (The modified code still brings an NPE later, maybe because FlagBitsPaneView can't handle null parameters) Maruan Sahyoun is this correct that the 4 widgets do not have an /FT entry? My understanding is that they are also terminal fields and that the field and widget entries are merged. The question is whether PDFDebugger should look upwards for the type, or just ignore the /Ff there.
        Hide
        kbashar khyrul bashar added a comment -

        I've made a patch assuming PDFDebugger is going to ignore the flag value if there is no Field Type.

        Show
        kbashar khyrul bashar added a comment - I've made a patch assuming PDFDebugger is going to ignore the flag value if there is no Field Type.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1689048 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1689048 ]

        PDFBOX-2530: NPE bugfix, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1689048 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1689048 ] PDFBOX-2530 : NPE bugfix, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks!

        Show
        tilman Tilman Hausherr added a comment - Thanks!
        Hide
        jahewson John Hewson added a comment - - edited

        I've found a problem: the name "F" appears in many different types of dictionary, e.g. file specifications, threads, outlines, FDF, sound objects, etc. So there needs to be a check on the parent dictionary's Type (and/or Subtype) to detect when to display the annotation flags view.

        The same applies to "Flags" which may appear in a form submit or reset action as well as a FontDescriptor.

        Show
        jahewson John Hewson added a comment - - edited I've found a problem: the name "F" appears in many different types of dictionary, e.g. file specifications, threads, outlines, FDF, sound objects, etc. So there needs to be a check on the parent dictionary's Type (and/or Subtype) to detect when to display the annotation flags view. The same applies to "Flags" which may appear in a form submit or reset action as well as a FontDescriptor.
        Hide
        kbashar khyrul bashar added a comment -

        I've also anticipated this when I was first writing this feature.
        Anyway, I've uploaded a patch. But I have no test file for negative testing.

        Show
        kbashar khyrul bashar added a comment - I've also anticipated this when I was first writing this feature. Anyway, I've uploaded a patch. But I have no test file for negative testing.
        Hide
        kbashar khyrul bashar added a comment -

        I've also anticipated this when I was first writing this feature.
        Anyway, I've uploaded a patch. But I have no test file for negative testing.

        Show
        kbashar khyrul bashar added a comment - I've also anticipated this when I was first writing this feature. Anyway, I've uploaded a patch. But I have no test file for negative testing.
        Hide
        tilman Tilman Hausherr added a comment -

        Could you please update the patch so that the object parameter isn't assigned to?

        Show
        tilman Tilman Hausherr added a comment - Could you please update the patch so that the object parameter isn't assigned to?
        Hide
        kbashar khyrul bashar added a comment - - edited

        Sorry, I don't understand. Which part are you indicating?

        Show
        kbashar khyrul bashar added a comment - - edited Sorry, I don't understand. Which part are you indicating?
        Hide
        tilman Tilman Hausherr added a comment -

        to understand what I mean, put "final" before the two "Object obj" parameters. Then change the code until there is no error. Then remove final.

        Show
        tilman Tilman Hausherr added a comment - to understand what I mean, put "final" before the two "Object obj" parameters. Then change the code until there is no error. Then remove final.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1689917 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1689917 ]

        PDFBOX-2530: improved flag checks, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1689917 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1689917 ] PDFBOX-2530 : improved flag checks, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks!

        Show
        tilman Tilman Hausherr added a comment - Thanks!
        Hide
        kbashar khyrul bashar added a comment -

        John Hewson Would you please give me some more details, what we want to show? what will be the representation like?

        Show
        kbashar khyrul bashar added a comment - John Hewson Would you please give me some more details, what we want to show? what will be the representation like?
        Hide
        jahewson John Hewson added a comment -

        There's a lot of data associated with fonts in PDF, then there's the font files themselves. Don't worry about covering everything there.

        For PDSimpleFont subclasses, we'd want to view the Encoding entry in the Font dictionary. Ideally you could retrieve the org.apache.pdfbox.pdmodel.font.encoding.Encoding object from the PDSimpleFont. Then the encoding is simply a map of character codes to glyph names, which you can display in a table. The character codes are always 0 to 255. Perhaps you could display missing glyphs in red by calling PDSimpleFont#hasGlyph(name).

        For PDType0Font subclasses, you'll need to look at the DescendantFont (there's always only one). When this is a PDCIDFontType2, then we want to display the CIDToGIDMap as a table. You can copy the code from readCIDToGIDMap to do this (I don't want to make that method public). This is simply a table of CID -> GID.

        Show
        jahewson John Hewson added a comment - There's a lot of data associated with fonts in PDF, then there's the font files themselves. Don't worry about covering everything there. For PDSimpleFont subclasses, we'd want to view the Encoding entry in the Font dictionary. Ideally you could retrieve the org.apache.pdfbox.pdmodel.font.encoding.Encoding object from the PDSimpleFont. Then the encoding is simply a map of character codes to glyph names, which you can display in a table. The character codes are always 0 to 255. Perhaps you could display missing glyphs in red by calling PDSimpleFont#hasGlyph(name). For PDType0Font subclasses, you'll need to look at the DescendantFont (there's always only one). When this is a PDCIDFontType2, then we want to display the CIDToGIDMap as a table. You can copy the code from readCIDToGIDMap to do this (I don't want to make that method public). This is simply a table of CID -> GID.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1690311 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1690311 ]

        PDFBOX-2530: implemented simple zoom feature for page pane

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1690311 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1690311 ] PDFBOX-2530 : implemented simple zoom feature for page pane
        Hide
        tilman Tilman Hausherr added a comment -

        initComponents() is getting somewhat messy. And this comment is misleading:

            /**
             * This method is called from within the constructor to
             * initialize the form.
             * WARNING: Do NOT modify this code. The content of this method is
             * always regenerated by the Form Editor.
             */
        

        Maybe this was produced by a form editor years ago...

        Show
        tilman Tilman Hausherr added a comment - initComponents() is getting somewhat messy. And this comment is misleading: /** * This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ Maybe this was produced by a form editor years ago...
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1690477 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1690477 ]

        PDFBOX-2530: use equals

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1690477 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1690477 ] PDFBOX-2530 : use equals
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1690561 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1690561 ]

        PDFBOX-2530: Show type and subtype for dictionaries

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1690561 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1690561 ] PDFBOX-2530 : Show type and subtype for dictionaries
        Hide
        jahewson John Hewson added a comment - - edited

        Yes, I'd say so. Could do with some refactoring at some point.

        Show
        jahewson John Hewson added a comment - - edited Yes, I'd say so. Could do with some refactoring at some point.
        Hide
        jahewson John Hewson added a comment -

        This is another feature from Acrobat Pro's structure viewer: showing the type and subtype of dictionaries. This makes it much easier to find the nod you're after without having to click through them all.

        Show
        jahewson John Hewson added a comment - This is another feature from Acrobat Pro's structure viewer: showing the type and subtype of dictionaries. This makes it much easier to find the nod you're after without having to click through them all.
        Hide
        kbashar khyrul bashar added a comment -

        Stream showing feature for PDFDebugger.
        This shows streams in different filtered version if available and also shows image if the stream is an image XObject.

        Show
        kbashar khyrul bashar added a comment - Stream showing feature for PDFDebugger. This shows streams in different filtered version if available and also shows image if the stream is an image XObject.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1690777 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1690777 ]

        PDFBOX-2530: show streams, images, filters, tooltips and search feature, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1690777 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1690777 ] PDFBOX-2530 : show streams, images, filters, tooltips and search feature, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks - a great start into a new week!

        Show
        tilman Tilman Hausherr added a comment - Thanks - a great start into a new week!
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691032 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691032 ]

        PDFBOX-2852, PDFBOX-2530: reduce code complexity; null parameter for setText() is legit

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691032 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691032 ] PDFBOX-2852 , PDFBOX-2530 : reduce code complexity; null parameter for setText() is legit
        Hide
        tilman Tilman Hausherr added a comment - - edited

        There is a new bug (class cast exception) when clicking on a page content stream when in "show pages" mode. Although the bug is new, I assume that the root cause (a MapEntry with a MapEntry) is older.

        Show
        tilman Tilman Hausherr added a comment - - edited There is a new bug (class cast exception) when clicking on a page content stream when in "show pages" mode. Although the bug is new, I assume that the root cause (a MapEntry with a MapEntry) is older.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691041 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691041 ]

        PDFBOX-2530: fix SonarQube issues

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691041 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691041 ] PDFBOX-2530 : fix SonarQube issues
        Hide
        tilman Tilman Hausherr added a comment -

        Commit msg has been fixed separately with correct attribution to you.

        Show
        tilman Tilman Hausherr added a comment - Commit msg has been fixed separately with correct attribution to you.
        Hide
        kbashar khyrul bashar added a comment -

        I've uploaded a patch.

        Show
        kbashar khyrul bashar added a comment - I've uploaded a patch.
        Hide
        kbashar khyrul bashar added a comment -

        Thanks

        Show
        kbashar khyrul bashar added a comment - Thanks
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691044 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691044 ]

        PDFBOX-2530: fix ClassCastException in page content streams when in page display mode, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691044 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691044 ] PDFBOX-2530 : fix ClassCastException in page content streams when in page display mode, as done by Khyrul Bashar in GSoC2015
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691060 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691060 ]

        PDFBOX-2530: UI tweak for image view

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691060 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691060 ] PDFBOX-2530 : UI tweak for image view
        Hide
        jahewson John Hewson added a comment -

        I was testing the new image view on some black-white gradient images but it was hard to tell what was the image and what was the background, so I made some minor tweaks.

        Show
        jahewson John Hewson added a comment - I was testing the new image view on some black-white gradient images but it was hard to tell what was the image and what was the background, so I made some minor tweaks.
        Hide
        jahewson John Hewson added a comment -

        Two minor issues:

        • PDImageXObject#getImage() returns the image with the mask applied, which means we can't view the raw image. Calling getOpaqueImage() instead would solve this.
        • Never use e.printStackTrace() Use "throw new RuntimeException(e)" instead. That way exceptions won't get lost. It's actually better still to "throw early and catch late" and let the caller handle the IOException.
        Show
        jahewson John Hewson added a comment - Two minor issues: PDImageXObject#getImage() returns the image with the mask applied, which means we can't view the raw image. Calling getOpaqueImage() instead would solve this. Never use e.printStackTrace() Use "throw new RuntimeException(e)" instead. That way exceptions won't get lost. It's actually better still to "throw early and catch late" and let the caller handle the IOException.
        Hide
        tilman Tilman Hausherr added a comment -

        How about checking if there is a mask, and offer both? I.e. with the mask as default, and optionally image without mask.

        Re printStackTrace - I agree, as long as the exception appears at some time.

        Show
        tilman Tilman Hausherr added a comment - How about checking if there is a mask, and offer both? I.e. with the mask as default, and optionally image without mask. Re printStackTrace - I agree, as long as the exception appears at some time.
        Hide
        tilman Tilman Hausherr added a comment -

        Why this?

        -        JComboBox filters = new JComboBox<String>(availableFilters);
        +        JComboBox filters = new JComboBox(availableFilters);
        
        Show
        tilman Tilman Hausherr added a comment - Why this? - JComboBox filters = new JComboBox< String >(availableFilters); + JComboBox filters = new JComboBox(availableFilters);
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691068 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691068 ]

        PDFBOX-2530: Show filters in menu labels

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691068 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691068 ] PDFBOX-2530 : Show filters in menu labels
        Hide
        jahewson John Hewson added a comment -

        JComboBox doesn't have a type parameter in Java 1.6.

        Show
        jahewson John Hewson added a comment - JComboBox doesn't have a type parameter in Java 1.6.
        Hide
        jahewson John Hewson added a comment -

        This makes it a bit easier to see which filters are applied to a stream when saving/viewing it.

        Show
        jahewson John Hewson added a comment - This makes it a bit easier to see which filters are applied to a stream when saving/viewing it.
        Hide
        jahewson John Hewson added a comment -

        Yes, adding "Image + Mask" as the default item in the drop down menu would work nicely.

        Show
        jahewson John Hewson added a comment - Yes, adding "Image + Mask" as the default item in the drop down menu would work nicely.
        Hide
        tilman Tilman Hausherr added a comment -

        John Hewson please add a ", " or whatever... this is what people see with the file of PDFBOX-2215-027073.pdf.

        Show
        tilman Tilman Hausherr added a comment - John Hewson please add a ", " or whatever... this is what people see with the file of PDFBOX-2215 -027073.pdf.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691077 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691077 ]

        PDFBOX-2530: Comma separation for filter labels

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691077 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691077 ] PDFBOX-2530 : Comma separation for filter labels
        Hide
        jahewson John Hewson added a comment -

        Yep, I put the code to do that on the wrong line. Will fix.

        Show
        jahewson John Hewson added a comment - Yep, I put the code to do that on the wrong line. Will fix.
        Hide
        tilman Tilman Hausherr added a comment -

        khyrul bashar please have a look at the attached file 317669-p213.pdf. It has a broken page content stream, but it is impossible to view the contents. I suggest some sort of recovery / disabling of advanced features if the stream parser throws an exception, so that the unfiltered stream can still be looked at even if the syntax is incorrect.

        Show
        tilman Tilman Hausherr added a comment - khyrul bashar please have a look at the attached file 317669-p213.pdf. It has a broken page content stream, but it is impossible to view the contents. I suggest some sort of recovery / disabling of advanced features if the stream parser throws an exception, so that the unfiltered stream can still be looked at even if the syntax is incorrect.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691476 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691476 ]

        PDFBOX-2530: Move zoom to View menu

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691476 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691476 ] PDFBOX-2530 : Move zoom to View menu
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1691634 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1691634 ]

        PDFBOX-2530: recover from exception in comtent stream, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1691634 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1691634 ] PDFBOX-2530 : recover from exception in comtent stream, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks for the fix!

        Show
        tilman Tilman Hausherr added a comment - Thanks for the fix!
        Hide
        kbashar khyrul bashar added a comment -

        Content stream specific feature for appearance stream, form, pattern and type3 font streams and Inline image data showing problem resolved from issue PDFBOX-2900.

        Show
        kbashar khyrul bashar added a comment - Content stream specific feature for appearance stream, form, pattern and type3 font streams and Inline image data showing problem resolved from issue PDFBOX-2900 .
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692428 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692428 ]

        PDFBOX-2530: color for certain operators in content streams (page content streams, but also appearance streams, form, pattern and type3 font streams), as done by Khyrul Bashar in GSoC2015
        PDFBOX-2900: restore missing inline image content, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692428 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692428 ] PDFBOX-2530 : color for certain operators in content streams (page content streams, but also appearance streams, form, pattern and type3 font streams), as done by Khyrul Bashar in GSoC2015 PDFBOX-2900 : restore missing inline image content, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks, this looks great! I made one small format change, and added another newline after the "ID", somehow this didn't hit my eye late yesterday although the "EI" did.

        Show
        tilman Tilman Hausherr added a comment - Thanks, this looks great! I made one small format change, and added another newline after the "ID", somehow this didn't hit my eye late yesterday although the "EI" did.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692431 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692431 ]

        PDFBOX-2530: add license header

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692431 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692431 ] PDFBOX-2530 : add license header
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692571 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692571 ]

        PDFBOX-2530: fix SonarQube issues, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692571 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692571 ] PDFBOX-2530 : fix SonarQube issues, as done by Khyrul Bashar in GSoC2015
        Hide
        kbashar khyrul bashar added a comment -

        Zoom menu code has been moved to a singleton class keeping the UI as is and zoom feature is enabled for images in the stream-pane.

        Show
        kbashar khyrul bashar added a comment - Zoom menu code has been moved to a singleton class keeping the UI as is and zoom feature is enabled for images in the stream-pane.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692625 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692625 ]

        PDFBOX-2530: zoom feature for images + refactor zoom menu as singleton, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692625 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692625 ] PDFBOX-2530 : zoom feature for images + refactor zoom menu as singleton, as done by Khyrul Bashar in GSoC2015
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692626 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692626 ]

        PDFBOX-2530: add javadocs, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692626 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692626 ] PDFBOX-2530 : add javadocs, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Another idea - would it be possible to keep some of the actionPerformed stuff in the ZoomMenu code? I.e. like this:

        • is the actionCommand a zoom command, e.g. ZoomMenu.isZoomCommand(actionCommand)
        • if yes: call ZoomMenu.getZoomScale(actionCommand)
        • use the return value as parameter for zoomImage or RenderWorker.
          This would remove double code.
        Show
        tilman Tilman Hausherr added a comment - Another idea - would it be possible to keep some of the actionPerformed stuff in the ZoomMenu code? I.e. like this: is the actionCommand a zoom command, e.g. ZoomMenu.isZoomCommand(actionCommand) if yes: call ZoomMenu.getZoomScale(actionCommand) use the return value as parameter for zoomImage or RenderWorker. This would remove double code.
        Hide
        kbashar khyrul bashar added a comment -

        Yeah. It's a better idea I think. I'll make patch.

        Show
        kbashar khyrul bashar added a comment - Yeah. It's a better idea I think. I'll make patch.
        Hide
        kbashar khyrul bashar added a comment -

        Done.

        Show
        kbashar khyrul bashar added a comment - Done.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692631 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692631 ]

        PDFBOX-2530: DRY refactoring, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692631 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692631 ] PDFBOX-2530 : DRY refactoring, as done by Khyrul Bashar in GSoC2015
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692632 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692632 ]

        PDFBOX-2530: split long method, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692632 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692632 ] PDFBOX-2530 : split long method, as done by Khyrul Bashar in GSoC2015
        Hide
        kbashar khyrul bashar added a comment -

        I've uploaded a draft patch > Font_encoding_pane_draft
        John Hewson would please review this and give some feedback?
        Another thing for simplefont I've added an Unicode character column as suggested by Tilman Hausherr. I want to have the same in CIDToGID table for Type0 Fonts But don't yet get the idea how to map CID/GID to character code. Need some help.

        Show
        kbashar khyrul bashar added a comment - I've uploaded a draft patch > Font_encoding_pane_draft John Hewson would please review this and give some feedback? Another thing for simplefont I've added an Unicode character column as suggested by Tilman Hausherr . I want to have the same in CIDToGID table for Type0 Fonts But don't yet get the idea how to map CID/GID to character code. Need some help.
        Hide
        kbashar khyrul bashar added a comment -

        Font encoding showing feature. For SimpleFont it shows the character code, glyph name and Unicode character in a table. And for Type0Font it shows the CIDToGID map and Unicode characters in a table.

        Show
        kbashar khyrul bashar added a comment - Font encoding showing feature. For SimpleFont it shows the character code, glyph name and Unicode character in a table. And for Type0Font it shows the CIDToGID map and Unicode characters in a table.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692711 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692711 ]

        PDFBOX-2530: show font encoding, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692711 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692711 ] PDFBOX-2530 : show font encoding, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Please see the file from PDFBOX-2904, at Root/Pages/Kids/[0]/Parent/Kids/[0]/Kids/[2]/Thumb:

        These thumbnails aren't shown. I did a quick and dirty change (that I won't commit) to see whether they are correct, and yes, these are real images.

        How to show them in PDFDebugger? They can be identified only by the key "Thumb" in PDFDebugger.showStream(). That method and the classes StreamPane / Stream have a different way of working with images and with content streams : PDFDebugger.showStream() decides whether it is a content stream, but the decision whether it is an image is made inside StreamPane / Stream. So I think that the decision about "is it an image" should be made before creating StreamPane. (Because StreamPane doesn't have the key)

        A second problem is in requestImageShowing(), this thumb image is not part of a PDResources, but it worked by passing an empty one.

        Show
        tilman Tilman Hausherr added a comment - Please see the file from PDFBOX-2904 , at Root/Pages/Kids/[0]/Parent/Kids/[0]/Kids/[2]/Thumb : These thumbnails aren't shown. I did a quick and dirty change (that I won't commit) to see whether they are correct, and yes, these are real images. How to show them in PDFDebugger? They can be identified only by the key "Thumb" in PDFDebugger.showStream(). That method and the classes StreamPane / Stream have a different way of working with images and with content streams : PDFDebugger.showStream() decides whether it is a content stream, but the decision whether it is an image is made inside StreamPane / Stream. So I think that the decision about "is it an image" should be made before creating StreamPane. (Because StreamPane doesn't have the key) A second problem is in requestImageShowing(), this thumb image is not part of a PDResources, but it worked by passing an empty one.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692907 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692907 ]

        PDFBOX-2530: fix SonarQube issues, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692907 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692907 ] PDFBOX-2530 : fix SonarQube issues, as done by Khyrul Bashar in GSoC2015
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1692924 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1692924 ]

        PDFBOX-2530: show page thumbnails, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1692924 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1692924 ] PDFBOX-2530 : show page thumbnails, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks, and congratulations for finding PDImageXObject.createThumbnail()

        Show
        tilman Tilman Hausherr added a comment - Thanks, and congratulations for finding PDImageXObject.createThumbnail()
        Hide
        jahewson John Hewson added a comment - - edited

        Here's my feedback on the font encoding view:

        • Have this view on the "Encoding" node, instead of the "Font" node.
        • Don't show the Unicode character, as it's not part of the Encoding (it's from the ToUnicode map, or GlyphList).
        • Make the font smaller
        • "Glyph Name" for missing glyphs should be ".notdef" instead of "No Glyph".
        • Only show rows in red if the glyph is missing from the font (i.e. when font.hasGlyph(name) == false).
        • Move the CIDToGID view onto the "CIDToGIDMap" node.
        • Don't show the Unicode character, as that isn't part of the CIDToGIDMap.

        It's a good start, well done. If you want to show Unicode characters then you might want to add a viewer for the ToUnicode map, but that's up to you. Also there's the CMap for a Type 0 fonts too, which maps codes -> CIDs.

        Show
        jahewson John Hewson added a comment - - edited Here's my feedback on the font encoding view: Have this view on the "Encoding" node, instead of the "Font" node. Don't show the Unicode character, as it's not part of the Encoding (it's from the ToUnicode map, or GlyphList). Make the font smaller "Glyph Name" for missing glyphs should be ".notdef" instead of "No Glyph". Only show rows in red if the glyph is missing from the font (i.e. when font.hasGlyph(name) == false). Move the CIDToGID view onto the "CIDToGIDMap" node. Don't show the Unicode character, as that isn't part of the CIDToGIDMap. It's a good start, well done. If you want to show Unicode characters then you might want to add a viewer for the ToUnicode map, but that's up to you. Also there's the CMap for a Type 0 fonts too, which maps codes -> CIDs.
        Hide
        tilman Tilman Hausherr added a comment -

        I strongly disagree with two points:

        • I asked him for the unicode character. This gives the information what the code in the content stream means. A text like "diaresis" (or whatever) doesn't mean much. This is too abstract.
        • I also asked for bigger fonts, the unicode for Zapf Dingbats was too hard to see at normal resolutions.
          About the rest, I either have no optinion, or I agree.
        Show
        tilman Tilman Hausherr added a comment - I strongly disagree with two points: I asked him for the unicode character. This gives the information what the code in the content stream means. A text like "diaresis" (or whatever) doesn't mean much. This is too abstract. I also asked for bigger fonts, the unicode for Zapf Dingbats was too hard to see at normal resolutions. About the rest, I either have no optinion, or I agree.
        Hide
        jahewson John Hewson added a comment -

        My thinking for those two points was as follows:

        • Encoding != ToUnicode, we need to be able to visualise encodings, without confusing the two concepts. For a given glyph name the font may use neither the corresponding Unicode character in the GlyphList, nor a glyph outline which matches it. I can see that there's value in displaying some sort of visual representation here though - if we instead use the GlyphList to fetch the corresponding Unicode character and label the column "Character", I think that would be both accurate and less confusing.
        • When debugging a simple encoding, I want to skim all 256 entries in the encoding as quickly as possible to look for anything unusual, hence wanting to make the font smaller. I think that we should focus on making a good debugging tool first, and "newbie guidance" second. Maybe a "show large characters" check box as a compromise?

        WDYT?

        Show
        jahewson John Hewson added a comment - My thinking for those two points was as follows: Encoding != ToUnicode, we need to be able to visualise encodings, without confusing the two concepts. For a given glyph name the font may use neither the corresponding Unicode character in the GlyphList, nor a glyph outline which matches it. I can see that there's value in displaying some sort of visual representation here though - if we instead use the GlyphList to fetch the corresponding Unicode character and label the column "Character", I think that would be both accurate and less confusing. When debugging a simple encoding, I want to skim all 256 entries in the encoding as quickly as possible to look for anything unusual, hence wanting to make the font smaller. I think that we should focus on making a good debugging tool first, and "newbie guidance" second. Maybe a "show large characters" check box as a compromise? WDYT?
        Hide
        tilman Tilman Hausherr added a comment -

        To clarify: except that everything isn't at the places you wish, is there anything that you miss? I'm asking this because I'm wonder if I directed my student on the wrong path.

        Re size: ok, with some teeth grinding. Maybe we can "misuse" the zoom menu, set size that was initially done (can be found in the repository) as 100% have that as default.

        Re encoding and toUnicode: yes, I'm aware that sometimes codes that don't have a glyph still have an unicode. Or that the ToUnicode value is incorrect (I have an example where toUnicode returns "q", but the glyph is a copyright symbol) But isn't it more practical to have everything in the font node, so you have less keyboard / mouse clicks to find the information?

        Re "Character" - the method used is toUnicode(), because that one returns one (maybe many) unicode characters when text extraction is done.

        Show
        tilman Tilman Hausherr added a comment - To clarify: except that everything isn't at the places you wish, is there anything that you miss? I'm asking this because I'm wonder if I directed my student on the wrong path. Re size: ok, with some teeth grinding. Maybe we can "misuse" the zoom menu, set size that was initially done (can be found in the repository) as 100% have that as default. Re encoding and toUnicode: yes, I'm aware that sometimes codes that don't have a glyph still have an unicode. Or that the ToUnicode value is incorrect (I have an example where toUnicode returns "q", but the glyph is a copyright symbol) But isn't it more practical to have everything in the font node, so you have less keyboard / mouse clicks to find the information? Re "Character" - the method used is toUnicode(), because that one returns one (maybe many) unicode characters when text extraction is done.
        Hide
        jahewson John Hewson added a comment - - edited

        Is there anything that you miss?

        CMap and ToUnicode, as mentioned above. Maybe also glyph previews.

        But isn't it more practical to have everything in the font node, so you have less keyboard / mouse clicks to find the information?

        I don't think we'll be able to fit CMap/Encoding, ToUnicode, and CIDToGIDMap all on the font node. (If this is going to get complex: we already have a tree structure for navigating them, so it makes sense to keep them separate. I'd rather keep navigation in the tree rather than re-create a new level of navigation inside the view.) What might be nice on the font node is some sort of overview, but I'm not sure what I'd want to see there - maybe tiles with previews of the glyphs?

        Re "Character" - the method used is toUnicode(), because that one returns one (maybe many) unicode characters when text extraction is done.

        Encoding and ToUnicode need to be kept separate, because they are too often confused. We could have both "Character" and "ToUnicode" columns (when present) to clarify?

        Show
        jahewson John Hewson added a comment - - edited Is there anything that you miss? CMap and ToUnicode, as mentioned above. Maybe also glyph previews. But isn't it more practical to have everything in the font node, so you have less keyboard / mouse clicks to find the information? I don't think we'll be able to fit CMap/Encoding, ToUnicode, and CIDToGIDMap all on the font node. (If this is going to get complex: we already have a tree structure for navigating them, so it makes sense to keep them separate. I'd rather keep navigation in the tree rather than re-create a new level of navigation inside the view.) What might be nice on the font node is some sort of overview, but I'm not sure what I'd want to see there - maybe tiles with previews of the glyphs? Re "Character" - the method used is toUnicode(), because that one returns one (maybe many) unicode characters when text extraction is done. Encoding and ToUnicode need to be kept separate, because they are too often confused. We could have both "Character" and "ToUnicode" columns (when present) to clarify?
        Hide
        msahyoun Maruan Sahyoun added a comment -

        I'd think that we should have the basic UI right with enhancements later. What I'd prefer is having an overview on the font node without digging into the details - possibly a tabbed view with glyph rendering as default and tables as second.

        I don't think we'll be able to fit CMap/Encoding, ToUnicode, and CIDToGIDMap all on the font node.

        Being able to compare the maps is beneficial e.g. when the rendering shows something different to the text extraction as shown by the above example. That's easier if one doesn't have to switch between the subsides and helps answering a typical issue - why is my text extract different to what I see on screen.

        maybe tiles with previews of the glyphs

        good idea - if possible showing in small for overview and - could be done later - enlarging and or additional information when hovering over?

        Encoding and ToUnicode need to be kept separate,

        +1

        Show
        msahyoun Maruan Sahyoun added a comment - I'd think that we should have the basic UI right with enhancements later. What I'd prefer is having an overview on the font node without digging into the details - possibly a tabbed view with glyph rendering as default and tables as second. I don't think we'll be able to fit CMap/Encoding, ToUnicode, and CIDToGIDMap all on the font node. Being able to compare the maps is beneficial e.g. when the rendering shows something different to the text extraction as shown by the above example. That's easier if one doesn't have to switch between the subsides and helps answering a typical issue - why is my text extract different to what I see on screen. maybe tiles with previews of the glyphs good idea - if possible showing in small for overview and - could be done later - enlarging and or additional information when hovering over? Encoding and ToUnicode need to be kept separate, +1
        Hide
        tilman Tilman Hausherr added a comment -

        We're getting in some very complex requirements. There are less than 4 weeks left. The most important requirement hasn't been done yet, which is a hex view on the stream / string. It is most important because that is the one that pushed me in creating this project.

        Show
        tilman Tilman Hausherr added a comment - We're getting in some very complex requirements. There are less than 4 weeks left. The most important requirement hasn't been done yet, which is a hex view on the stream / string. It is most important because that is the one that pushed me in creating this project.
        Hide
        tilman Tilman Hausherr added a comment -

        But "ToUnicode" was done, it's just not at the place you wish. What I mean is that the code exists, it just has to be moved elsewhere.

        Glyph preview would be complex - it would involve cloning parts of PageDrawer.

        Show
        tilman Tilman Hausherr added a comment - But "ToUnicode" was done, it's just not at the place you wish. What I mean is that the code exists, it just has to be moved elsewhere. Glyph preview would be complex - it would involve cloning parts of PageDrawer.
        Hide
        msahyoun Maruan Sahyoun added a comment -

        OK - let's keep the 'font view' as is and work on the hex view. If there is time left to revisit the font discussion fine. Otherwise we should be able to move the code/view to where we believe it best fits.

        Show
        msahyoun Maruan Sahyoun added a comment - OK - let's keep the 'font view' as is and work on the hex view. If there is time left to revisit the font discussion fine. Otherwise we should be able to move the code/view to where we believe it best fits.
        Hide
        jahewson John Hewson added a comment -

        possibly a tabbed view with glyph rendering as default and tables as second.

        That's exactly what I'd like to avoid when I said "keep navigation in the tree rather than re-create a new level of navigation inside the view.". What is the benefit of two levels of nested navigation?

        That's easier if one doesn't have to switch between the subsides

        How is it easier?

        enlarging and or additional information when hovering over?

        Then you can't get an overview at a glance... like a game of whack-a-mole.

        Show
        jahewson John Hewson added a comment - possibly a tabbed view with glyph rendering as default and tables as second. That's exactly what I'd like to avoid when I said "keep navigation in the tree rather than re-create a new level of navigation inside the view.". What is the benefit of two levels of nested navigation? That's easier if one doesn't have to switch between the subsides How is it easier? enlarging and or additional information when hovering over? Then you can't get an overview at a glance... like a game of whack-a-mole.
        Hide
        jahewson John Hewson added a comment -

        "ToUnicode" isn't done for Type 0 fonts though, nor is the Encoding entry (CMap). Agreed that Glyph preview is probably to complex for the time available.

        Show
        jahewson John Hewson added a comment - "ToUnicode" isn't done for Type 0 fonts though, nor is the Encoding entry (CMap). Agreed that Glyph preview is probably to complex for the time available.
        Hide
        jahewson John Hewson added a comment -

        I think that the minimum we still need is simply:

        • have both "Character" and "ToUnicode" columns
        Show
        jahewson John Hewson added a comment - I think that the minimum we still need is simply: have both "Character" and "ToUnicode" columns
        Hide
        tilman Tilman Hausherr added a comment -

        Can you explain this?

        • in what node do you want that one?
        • what is "character" - a text like "diaresis", a code, or something else?
        • what is "toUnicode" - is that the result of PDFont.toUnicode(code), or something else?
        Show
        tilman Tilman Hausherr added a comment - Can you explain this? in what node do you want that one? what is "character" - a text like "diaresis", a code, or something else? what is "toUnicode" - is that the result of PDFont.toUnicode(code), or something else?
        Hide
        jahewson John Hewson added a comment - - edited
        • Node = wherever it currently is will be fine (simple fonts only)
        • Character = the Unicode character which corresponds to the glyph name, i.e. PDSimpleFont#getGlyphList().toUnicode(name)
        • ToUnicode = value of PDFont.toUnicode(code), as is currently being used

        As an added bonus if character != toUnicode then show the entry in bold.

        Show
        jahewson John Hewson added a comment - - edited Node = wherever it currently is will be fine (simple fonts only) Character = the Unicode character which corresponds to the glyph name, i.e. PDSimpleFont#getGlyphList().toUnicode(name) ToUnicode = value of PDFont.toUnicode(code), as is currently being used As an added bonus if character != toUnicode then show the entry in bold.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693678 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693678 ]

        PDFBOX-2530: Display content stream strings with correct escapes

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693678 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693678 ] PDFBOX-2530 : Display content stream strings with correct escapes
        Hide
        jahewson John Hewson added a comment -

        This fixes an issue with the display of strings in content streams, where we were displaying the decoded string, rather than the encoded version which appears in a content stream.

        Show
        jahewson John Hewson added a comment - This fixes an issue with the display of strings in content streams, where we were displaying the decoded string, rather than the encoded version which appears in a content stream.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693714 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693714 ]

        PDFBOX-2530: add rotation menu for pages and images

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693714 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693714 ] PDFBOX-2530 : add rotation menu for pages and images
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693722 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693722 ]

        PDFBOX-2530: refactor to have common base for ZoomMenu and RotationMenu

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693722 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693722 ] PDFBOX-2530 : refactor to have common base for ZoomMenu and RotationMenu
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693723 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693723 ]

        PDFBOX-2530: remove dead code

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693723 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693723 ] PDFBOX-2530 : remove dead code
        Hide
        tilman Tilman Hausherr added a comment -

        khyrul bashar I created a base class because there was too much double code due to the new RotationMenu. I changed menuListeners to addMenuListeners because the "chaining" prevented it from moving into the base class.

        Show
        tilman Tilman Hausherr added a comment - khyrul bashar I created a base class because there was too much double code due to the new RotationMenu. I changed menuListeners to addMenuListeners because the "chaining" prevented it from moving into the base class.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693749 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693749 ]

        PDFBOX-2530: fix first page selection in page mode

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693749 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693749 ] PDFBOX-2530 : fix first page selection in page mode
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693804 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693804 ]

        PDFBOX-2530: make class final

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693804 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693804 ] PDFBOX-2530 : make class final
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693809 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693809 ]

        PDFBOX-2530: add "Open URL" menu item

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693809 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693809 ] PDFBOX-2530 : add "Open URL" menu item
        Hide
        tilman Tilman Hausherr added a comment -

        use case for this: it allows to test URLs of PDFs without saving them first. I use URLs a lot when looking at test files of other projects (ghostscript and pdf.js).

        Show
        tilman Tilman Hausherr added a comment - use case for this: it allows to test URLs of PDFs without saving them first. I use URLs a lot when looking at test files of other projects (ghostscript and pdf.js).
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693821 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693821 ]

        PDFBOX-2530: Full syntax highlighting and nesting

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693821 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693821 ] PDFBOX-2530 : Full syntax highlighting and nesting
        Hide
        jahewson John Hewson added a comment - - edited

        I was debugging some content streams and though that this would be handy. It's the natural extension of Khyrul's bracketed operator highlighting code. Instead of highlighting specific operators, I've syntax highlighted the entire content stream and used indentation to mark Q...q and BT...ET operators.

        Show
        jahewson John Hewson added a comment - - edited I was debugging some content streams and though that this would be handy. It's the natural extension of Khyrul's bracketed operator highlighting code. Instead of highlighting specific operators, I've syntax highlighted the entire content stream and used indentation to mark Q...q and BT...ET operators.
        Hide
        tilman Tilman Hausherr added a comment - - edited

        Nice... However I miss the colors for Q..q and BT..ET, i.e. it would be better if they'd had their own colors as before.

        Show
        tilman Tilman Hausherr added a comment - - edited Nice... However I miss the colors for Q..q and BT..ET, i.e. it would be better if they'd had their own colors as before.
        Hide
        tilman Tilman Hausherr added a comment - - edited

        See screenshot-1 - at the bottom, the Q is not at the correct indent.

        And screenshot-2 - ET not at the correct indent.

        And screenshot-3 - inline images not indented (BI....EI)

        Show
        tilman Tilman Hausherr added a comment - - edited See screenshot-1 - at the bottom, the Q is not at the correct indent. And screenshot-2 - ET not at the correct indent. And screenshot-3 - inline images not indented (BI....EI)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693823 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693823 ]

        PDFBOX-2530: javadoc

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693823 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693823 ] PDFBOX-2530 : javadoc
        Hide
        jahewson John Hewson added a comment - - edited

        Syntactically they're just operators, so I'm not sure why you'd want them highlighted differently. They're not a separate grammatical construct. It's like wanting to highlight a Java "if" differently from "while" because one's a loop... but that's not a meaningful syntactic distinction. With nesting, such color coding is already redundant.

        Show
        jahewson John Hewson added a comment - - edited Syntactically they're just operators, so I'm not sure why you'd want them highlighted differently. They're not a separate grammatical construct. It's like wanting to highlight a Java "if" differently from "while" because one's a loop... but that's not a meaningful syntactic distinction. With nesting, such color coding is already redundant.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1693855 from John Hewson in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1693855 ]

        PDFBOX-2530: Clean up Find menu UI

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1693855 from John Hewson in branch 'pdfbox/trunk' [ https://svn.apache.org/r1693855 ] PDFBOX-2530 : Clean up Find menu UI
        Hide
        jahewson John Hewson added a comment - - edited

        This fixes an important issue: menus (being as they are, pedagogical) should be visible at all times and be enabled/disabled as appropriate. Lets not add any more appearing/disappearing menus in the future.

        Show
        jahewson John Hewson added a comment - - edited This fixes an important issue: menus (being as they are, pedagogical) should be visible at all times and be enabled/disabled as appropriate. Lets not add any more appearing/disappearing menus in the future.
        Hide
        jahewson John Hewson added a comment -

        Will take a look at this...

        Show
        jahewson John Hewson added a comment - Will take a look at this...
        Hide
        tilman Tilman Hausherr added a comment -

        Yes it is adding visibility by nesting, but at the same time losing visibility by removing special colors for special operators. The colors make is easier to see them in a long content stream. Maybe they are "just operators", but they play different roles for the PDF. Text operators aren't the same as the graphics save/restore operators.

        Show
        tilman Tilman Hausherr added a comment - Yes it is adding visibility by nesting, but at the same time losing visibility by removing special colors for special operators. The colors make is easier to see them in a long content stream. Maybe they are "just operators", but they play different roles for the PDF. Text operators aren't the same as the graphics save/restore operators.
        Hide
        tilman Tilman Hausherr added a comment -

        Don't know if this is new, but I get a string out of bounds exception popup when hovering over "1 scn".

        Show
        tilman Tilman Hausherr added a comment - Don't know if this is new, but I get a string out of bounds exception popup when hovering over "1 scn".
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1694088 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1694088 ]

        PDFBOX-2530: rename variable so that it is different from field; move closing to caller

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1694088 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1694088 ] PDFBOX-2530 : rename variable so that it is different from field; move closing to caller
        Hide
        tilman Tilman Hausherr added a comment -

        khyrul bashar Can you please check this: in the file of PDFBOX-2917, go to the content stream (Root/Pages/Kids/[0]/Kids/[0]/Kids/[0]/Contents), enter CTRL-F and enter X36. Then press F3 - IndexOutOfBoundsException.

        Show
        tilman Tilman Hausherr added a comment - khyrul bashar Can you please check this: in the file of PDFBOX-2917 , go to the content stream ( Root/Pages/Kids/[0]/Kids/[0]/Kids/[0]/Contents ), enter CTRL-F and enter X36. Then press F3 - IndexOutOfBoundsException.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1694535 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1694535 ]

        PDFBOX-2530: fixed IndexOutOfBoundsException if there is only one search result, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1694535 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1694535 ] PDFBOX-2530 : fixed IndexOutOfBoundsException if there is only one search result, as done by Khyrul Bashar in GSoC2015
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1694785 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1694785 ]

        PDFBOX-2530: Avoid NPE if no file is open when switching view mode

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1694785 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1694785 ] PDFBOX-2530 : Avoid NPE if no file is open when switching view mode
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1694825 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1694825 ]

        PDFBOX-2530: avoid string out of bounds exception for scn; catch device colors

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1694825 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1694825 ] PDFBOX-2530 : avoid string out of bounds exception for scn; catch device colors
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1694827 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1694827 ]

        PDFBOX-2530: avoid NPE risk created in previous commit

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1694827 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1694827 ] PDFBOX-2530 : avoid NPE risk created in previous commit
        Hide
        tilman Tilman Hausherr added a comment - - edited

        khyrul bashar I've found the cause of the string out of bounds exception, it wasn't by John, he just made it more likely to happen. The extra spaces at the front were making trouble. After fixing that with a trim, still no color appeared; the cause was the failure to "get" colorspaces that were not in the resource map, like /DeviceRGB. (I suspect you didn't know about COSName.getPDFName so you looped through the colorspaces in the resource map)

        Show
        tilman Tilman Hausherr added a comment - - edited khyrul bashar I've found the cause of the string out of bounds exception, it wasn't by John, he just made it more likely to happen. The extra spaces at the front were making trouble. After fixing that with a trim, still no color appeared; the cause was the failure to "get" colorspaces that were not in the resource map, like /DeviceRGB. (I suspect you didn't know about COSName.getPDFName so you looped through the colorspaces in the resource map)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1695390 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1695390 ]

        PDFBOX-2530: display COSDictionary objects as such when showing content streams

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1695390 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1695390 ] PDFBOX-2530 : display COSDictionary objects as such when showing content streams
        Hide
        tilman Tilman Hausherr added a comment -

        Effect can be seen when showing content stream of the file of PDFBOX-2929.

        Show
        tilman Tilman Hausherr added a comment - Effect can be seen when showing content stream of the file of PDFBOX-2929 .
        Hide
        msahyoun Maruan Sahyoun added a comment -

        Tilman Hausherr what about using stream.createRawInputStream() instead of stream.getUnfilteredStream() around line 930 as COSStream.getUnfilteredStream() is deprecated?

        Show
        msahyoun Maruan Sahyoun added a comment - Tilman Hausherr what about using stream.createRawInputStream() instead of stream.getUnfilteredStream() around line 930 as COSStream.getUnfilteredStream() is deprecated?
        Hide
        tilman Tilman Hausherr added a comment -

        There are many... however I suspect that the javadoc is wrong:

            /**
             * This will get the logical content stream with none of the filters.
             *
             * @return the bytes of the logical (decoded) stream
             * @throws IOException when decoding causes an exception
             * @deprecated Use {@link #createRawInputStream()} instead.
             */
            @Deprecated
            public InputStream getUnfilteredStream() throws IOException
            {
                return createInputStream();
            }
        
        Show
        tilman Tilman Hausherr added a comment - There are many... however I suspect that the javadoc is wrong: /** * This will get the logical content stream with none of the filters. * * @ return the bytes of the logical (decoded) stream * @ throws IOException when decoding causes an exception * @deprecated Use {@link #createRawInputStream()} instead. */ @Deprecated public InputStream getUnfilteredStream() throws IOException { return createInputStream(); }
        Hide
        tilman Tilman Hausherr added a comment -

        There are many... however I suspect that the javadoc is wrong:

            /**
             * This will get the logical content stream with none of the filters.
             *
             * @return the bytes of the logical (decoded) stream
             * @throws IOException when decoding causes an exception
             * @deprecated Use {@link #createRawInputStream()} instead.
             */
            @Deprecated
            public InputStream getUnfilteredStream() throws IOException
            {
                return createInputStream();
            }
        
        Show
        tilman Tilman Hausherr added a comment - There are many... however I suspect that the javadoc is wrong: /** * This will get the logical content stream with none of the filters. * * @ return the bytes of the logical (decoded) stream * @ throws IOException when decoding causes an exception * @deprecated Use {@link #createRawInputStream()} instead. */ @Deprecated public InputStream getUnfilteredStream() throws IOException { return createInputStream(); }
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1695557 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1695557 ]

        PDFBOX-2530: fix indent of closing operators; add BMC/BDC/EMC to indent logic

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1695557 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1695557 ] PDFBOX-2530 : fix indent of closing operators; add BMC/BDC/EMC to indent logic
        Hide
        jahewson John Hewson added a comment -

        Thanks

        Show
        jahewson John Hewson added a comment - Thanks
        Hide
        kbashar khyrul bashar added a comment -

        Hex viewer for strings and streams.

        Show
        kbashar khyrul bashar added a comment - Hex viewer for strings and streams.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1697042 from Tilman Hausherr in branch 'pdfbox/trunk'
        [ https://svn.apache.org/r1697042 ]

        PDFBOX-2530: add hex viewer for streams and strings, as done by Khyrul Bashar in GSoC2015

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1697042 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1697042 ] PDFBOX-2530 : add hex viewer for streams and strings, as done by Khyrul Bashar in GSoC2015
        Hide
        tilman Tilman Hausherr added a comment -

        Thanks! This concludes GSoC2015. Thanks for all your work!

        I have opened a follow-up issue PDFBOX-2941 for further ideas related to PDFDebugger. You're welcome there

        Show
        tilman Tilman Hausherr added a comment - Thanks! This concludes GSoC2015. Thanks for all your work! I have opened a follow-up issue PDFBOX-2941 for further ideas related to PDFDebugger. You're welcome there
        Hide
        kbashar khyrul bashar added a comment -

        Thanks everyone for your support and suggestions. It was my first open source contribution at a scale and for me the experience was remarkable and I wish to continue to work on the PDFDebugger.

        Show
        kbashar khyrul bashar added a comment - Thanks everyone for your support and suggestions. It was my first open source contribution at a scale and for me the experience was remarkable and I wish to continue to work on the PDFDebugger.