Packages

 

com.aspose.psd.fileformats.psd.resources

Class BorderInformationResource



  • public final class BorderInformationResource
    extends ResourceBlock

    The resource with border information of image print settings.

    Code example:

    An example of reading, modifying and saving a PSD file that contains a border information resource.


                
    String inPsdFilePath = "input.psd";
    String outPsdFilePath = "output.psd";
                
    // Load a PSD file containing a predefined image resource
    PsdImage psdImage = (PsdImage)Image.load(inPsdFilePath);
    try
    {
        ResourceBlock[] imageResources = psdImage.getImageResources();
                
        // Find first border information resource in image resources
        BorderInformationResource borderInfoResource = null;
        for (ResourceBlock imageResource : imageResources)
        {
            if (imageResource instanceof BorderInformationResource)
            {
                borderInfoResource = (BorderInformationResource)imageResource;
                break;
            }
        }
                
        // Update some properties of the border information resource
        borderInfoResource.setWidth(0.1);
        borderInfoResource.setUnit(PhysicalUnit.Inches);
                
        // Save a modified copy of loaded PSD file on the path
        psdImage.save(outPsdFilePath);
    }
    finally
    {
        psdImage.dispose();
    }
    

    • Constructor Detail

      • BorderInformationResource

        public BorderInformationResource()

        Initializes a new instance of the BorderInformationResource class.

    • Method Detail

      • getDataSize

        public int getDataSize()

        Gets the resource data size in bytes.

        Value: The resource data size.
        Specified by:
        getDataSize in class ResourceBlock
      • getMinimalVersion

        public int getMinimalVersion()

        Gets the minimal required PSD version.

        Value: The minimal PSD version.
        Specified by:
        getMinimalVersion in class ResourceBlock
      • getWidth

        public final double getWidth()

        Gets or sets the border width.

      • setWidth

        public final void setWidth(double value)

        Gets or sets the border width.

      • getUnit

        public final int getUnit()

        Gets or sets the border units.

      • setUnit

        public final void setUnit(int value)

        Gets or sets the border units.