com.aspose.omr

Class OmrTemplate



  • public class OmrTemplate
    extends Object
    • Constructor Detail

      • OmrTemplate

        public OmrTemplate()

        Initializes a new instance of the OmrTemplate class.

    • Method Detail

      • getPages

        public OmrPagesCollection getPages()
        Gets the collection of pages within the template
        Returns:
      • load

        public static OmrTemplate load(InputStream stream)
        Loads the template.
        Parameters:
        stream - Stream to load the template from.
        Returns:
        The freshly loaded OmrTemplate


         
          InputStream stream = new FileInputStream(fileName);
          OmrTemplate template = OmrTemplate.load(stream);
         

      • load

        public static OmrTemplate load(String fileName)

        Loads the template.

        Parameters:
        fileName - Name of the file to load the template from.


         
         OmrTemplate template = OmrTemplate.load("template.amr"); // template path
         

        Returns:
        The freshly loaded OmrTemplate.
      • loadFromUrl

        public static OmrTemplate loadFromUrl(String url)
                                       throws IOException
        Loads the template from URL.
        Parameters:
        url - The source URL.
        Returns:
        The freshly loaded .
        Throws:
        IOException
      • save

        public void save(OutputStream stream)

        Saves the template.

        Parameters:
        stream - Stream to save the template to.
      • save

        public void save(String fileName)
                  throws IOException

        Saves the template.

        Parameters:
        fileName - Name of the file to save the template to.


                         
                         OmrTemplate template = new OmrTemplate();
                         OmrImage image = OmrImage.load(@"image.png");
                         template.getPages().getItem(0).setSheetImage(image);
                         template.save("template.amr");
                         

        Throws:
        IOException