3 Replies Latest reply on Oct 23, 2014 9:20 AM by Jump_Over

    Output a JPG / PNG of a section of a page


      Any help would be appreciated with the following.


      I have an online preview system where a user can upload an in design document and fill out web form controls (text boxes, check boxes, etc) to generate a quick preview of the output of an in design document as a JPG.


      What I want to do next is when a user enters into a form field I want in design server to output a section of the page as a high DPI JPG to show to the user what section of the page the user is editing.


      I know the pages and the bounds on which the custom field is on. Is there a way to create a new document or a new page and say output just this section in a higher DPI to output a high res JPG?



        • 1. Re: Output a JPG / PNG of a section of a page
          Pickory Level 3



          You could create a new frame covering the area you want, then add it and all the items below to a group and export the group.


          If you are up to a bit of C++ you could look at the Snap shot utils sample plugin.



          • 2. Re: Output a JPG / PNG of a section of a page
            DustinMichaels1982 Level 1

            I'm not sure if that would work.


            If I know that I want a preview of section A and it covers just 5% of the page for the preview option I would want a zoomed in picture of the page but also include some of the surrounding areas as well. Is something like this possible?


            I know the bounds of the page and the bounds of the element. Is there a method around saying print out a section of a page with just these bounds (I should be able to calculate this).

            • 3. Re: Output a JPG / PNG of a section of a page
              Jump_Over Level 5



              I suggest a workflow like this:

              1. dialog ask user for number of page and section coordinates (lets say left-up corner, width and height) in active doc;

              2. the surrounding area size can be set there as well;

              3. this dialog let user to choose some output properties including output file path;

              4. entire page is exported to a temp file;

              5. new doc and empty rectangle with proper size is created;

              6. rectangle's stroke is as wide as surrinding area is set;

              7. rectangle's stroke transparency is set to some value (another dialog entry?);

              8. page as an image is loaded there and moved to proper position;

              9. rectangle is exported as JPG or PNG (CS6+) according to dialog choices.


              I should take 1-2 hours. How worth is it for you?