2 Replies Latest reply on Jul 31, 2017 7:57 AM by JJMack

    Resize a layer


      I have a design of Card in Photoshop. There are four pages hence 4 layers. I have images in PDF as pages. I have to copy pages from pdf to each page on card: page 1 of pdf to layer1 of card page2 to layer2 and so on. The layers are not rectangular but varied dimension to give 3d look. How do I paste and resize page from pdf to layer in photoshop. the resize function takes width and height. but my layer is not rectangular.123.jpg

        • 1. Re: Resize a layer
          c.pfaffenbichler Level 9

          Copy/pasting via Script is usually a bad idea.

          I expect using four Smart Objects and switching in the new content may provide a reasonable approach.


          Please provide the layered psd and one sample pdf.

          • 2. Re: Resize a layer
            JJMack Most Valuable Participant

            Looking at your example your card four side are rectangles that are the same size. They have a perspective distortion added to match the card perspective views in your document.  This would be easily handled with a template the has four Smart Object layers that the layers associated transform  distorts the card sides content perspective.   The contents of your card's sides seem to be composites of text, graphics and images.  I question your intention of storing the four cards sides in PDF files and using a Photoshop script to populate your template using the PDF files content..  While Photoshop can process PDF files they requires some special handling because of the PDF file format. It will not be a simple file open or file place.  You need to import PDF Pages and set what they should be scaled to in pixels. The script would need import the PDF pages as documents and copy the documents into your template then figure out how to add the preoperative transform that would position and transform the page into its place. I feel it would far easier to script it. If you stored your four card sides in native Photoshop PSD file in a card's sides folder.   It will make modifying card content easier and all the script need to do is replace the contents of the templates four  smart object layers with the PSD file object.


            Here you see how Photoshop would need to import four PDF pages look at the Page import dialog.  The Script would need to import pages set the page number and page scaling settings.




            You could also just create a simple Collage template the uses Alpha channels to map Image locations size and shape.  Use the scripts in my photo collage toolkit to populate that template.  My Script would place in your PSD file position and size and shape them.  However, the transform set by my Scripts would not add any perspective distortion.   But my script will create  populated  layer document.  Youcan manually change its smart object layers associated transform to add the perspective distortion you need.   Distorting Place image would not be an easy thing to script IMO.   It may be possible. But my mind could not conger up a simple template design that would make scripting it possible.  It was very important for me to keep my template design simple clean and easy to create and populate via Photoshop scripting.


            Your overlapping image where one image opacity  or blend is set so the lower  layer's image shows is also something that would be difficult to script using a simple template design. Again  I would just use my existing scripts and manually post process my populated document to add that blending.  If fact your that blending you show in your example would require a layer mask for the populated page content.  I do not think it would even be possible with a template that uses smart object layers  that content is replaced for the layer mask required for the new content would be different then the mask in the template