原文:https://www.cnblogs.com/baby123/p/11046704.html

 

前一段时间使用aspose.slides for java,处理了下才去除的水印,但是时间一久就忘记了,重新整理了下

下载aspose-slides-19.3-jdk16.jar,重命名为aspose.slides-19.3.jar(为了在maven应用才改名的)

(1)使用jd-gui查看jar包

注册文件的加载类License

aspose.slides for java去除水印
package com.aspose.slides;

import com.aspose.slides.exceptions.InvalidOperationException;
import com.aspose.slides.internal.k5.return;
import com.aspose.slides.ms.System.IDisposable;
import com.aspose.slides.ms.System.p;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class License
  implements ILicense
{
  public void setLicense(InputStream stream)
    throws AsposeLicenseException
  {
    try
    {
      ByteArrayInputStream localByteArrayInputStream = null;
      if (stream != null)
      {
        localObject = new ByteArrayOutputStream();
        byte[] arrayOfByte = new byte[1024];
        int i;
        while ((i = stream.read(arrayOfByte)) > 0)
          ((ByteArrayOutputStream)localObject).write(arrayOfByte, 0, i);
        ((ByteArrayOutputStream)localObject).flush();
        localByteArrayInputStream = new ByteArrayInputStream(((ByteArrayOutputStream)localObject).toByteArray());
      }
      Object localObject = new return();
      ((return)localObject).jdMethod_do(localByteArrayInputStream);
    }
    catch (IOException localIOException1)
    {
      throw new InvalidOperationException("License stream is not available for reading");
    }
  }

  public void setLicense(String namePath)
    throws AsposeLicenseException
  {
    try
    {
      FileInputStream localFileInputStream = null;
      if ((null != namePath) && (!"".equals(namePath)))
        localFileInputStream = new FileInputStream(namePath);
      setLicense(localFileInputStream);
    }
    catch (FileNotFoundException localFileNotFoundException1)
    {
      throw new InvalidOperationException("License stream is not available for reading");
    }
  }

  public static String getVersion()
  {
    return return.jdMethod_new();
  }

  public void resetLicense()
  {
    return.jdMethod_for();
  }

  public boolean isLicensed()
  {
    int i = 0;
    Presentation localPresentation = new Presentation();
    try
    {
      ISlide localISlide = localPresentation.getSlides().addEmptySlide(localPresentation.getLayoutSlides().getByType(11));
      IAutoShape localIAutoShape = localISlide.getShapes().addAutoShape(5, 10.0F, 10.0F, 200.0F, 100.0F);
      localIAutoShape.getTextFrame().setText(p.jdMethod_if("", 500, 'a'));
      i = localIAutoShape.getTextFrame().getText().length() == 500 ? 1 : 0;
    }
    finally
    {
      if (localPresentation != null)
        localPresentation.dispose();
    }
    return i;
  }
}
aspose.slides for java去除水印

相关文章:

  • 2021-12-04
  • 2021-12-08
  • 2022-01-05
  • 2021-12-15
  • 2021-12-22
  • 2021-11-26
  • 2022-02-02
  • 2021-12-18
猜你喜欢
  • 2021-05-19
  • 2021-09-04
  • 2022-02-23
  • 2021-03-30
  • 2021-05-16
  • 2021-12-18
相关资源
相似解决方案