com.itextpdf.text.Rectangle.getRotation()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中com.itextpdf.text.Rectangle.getRotation方法的一些代码示例,展示了Rectangle.getRotation的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.getRotation方法的具体详情如下:
包路径:com.itextpdf.text.Rectangle
类名称:Rectangle
方法名:getRotation

Rectangle.getRotation介绍

[英]Gets the rotation of the rectangle
[中]获取矩形的旋转

代码示例

代码示例来源:origin: com.itextpdf/itextpdf

/** Convenience method to set the field rotation the same as the
 * page rotation.
 * @param page the page
 */
public void setRotationFromPage(Rectangle page) {
  setRotation(page.getRotation());
}

代码示例来源:origin: com.itextpdf/itextg

/** Convenience method to set the field rotation the same as the
 * page rotation.
 * @param page the page
 */
public void setRotationFromPage(Rectangle page) {
  setRotation(page.getRotation());
}

代码示例来源:origin: com.itextpdf/itextpdf

int rotation = page.getRotation();
switch (rotation) {
  case 90:

代码示例来源:origin: com.itextpdf/itextg

int rotation = page.getRotation();
switch (rotation) {
  case 90:

代码示例来源:origin: com.itextpdf/itextpdf

int rotation = pageSize.getRotation();
      thisBoxSize.put("trim", thisBoxSize.get("crop"));
    else
      thisBoxSize.put("trim", new PdfRectangle(pageSize, pageSize.getRotation()));

代码示例来源:origin: com.itextpdf/itextg

int rotation = pageSize.getRotation();
      thisBoxSize.put("trim", thisBoxSize.get("crop"));
    else
      thisBoxSize.put("trim", new PdfRectangle(pageSize, pageSize.getRotation()));

代码示例来源:origin: com.itextpdf/itextg

void applyRotation(PdfDictionary pageN, ByteBuffer out) {
  if (!cstp.rotateContents)
    return;
  Rectangle page = reader.getPageSizeWithRotation(pageN);
  int rotation = page.getRotation();
  switch (rotation) {
    case 90:
      out.append(PdfContents.ROTATE90);
      out.append(page.getTop());
      out.append(' ').append('0').append(PdfContents.ROTATEFINAL);
      break;
    case 180:
      out.append(PdfContents.ROTATE180);
      out.append(page.getRight());
      out.append(' ');
      out.append(page.getTop());
      out.append(PdfContents.ROTATEFINAL);
      break;
    case 270:
      out.append(PdfContents.ROTATE270);
      out.append('0').append(' ');
      out.append(page.getRight());
      out.append(PdfContents.ROTATEFINAL);
      break;
  }
}

代码示例来源:origin: com.itextpdf/itextpdf

void applyRotation(PdfDictionary pageN, ByteBuffer out) {
  if (!rotateContents)
    return;
  Rectangle page = reader.getPageSizeWithRotation(pageN);
  int rotation = page.getRotation();
  switch (rotation) {
    case 90:
      out.append(PdfContents.ROTATE90);
      out.append(page.getTop());
      out.append(' ').append('0').append(PdfContents.ROTATEFINAL);
      break;
    case 180:
      out.append(PdfContents.ROTATE180);
      out.append(page.getRight());
      out.append(' ');
      out.append(page.getTop());
      out.append(PdfContents.ROTATEFINAL);
      break;
    case 270:
      out.append(PdfContents.ROTATE270);
      out.append('0').append(' ');
      out.append(page.getRight());
      out.append(PdfContents.ROTATEFINAL);
      break;
  }
}

代码示例来源:origin: com.itextpdf/itextpdf

void applyRotation(PdfDictionary pageN, ByteBuffer out) {
  if (!cstp.rotateContents)
    return;
  Rectangle page = reader.getPageSizeWithRotation(pageN);
  int rotation = page.getRotation();
  switch (rotation) {
    case 90:
      out.append(PdfContents.ROTATE90);
      out.append(page.getTop());
      out.append(' ').append('0').append(PdfContents.ROTATEFINAL);
      break;
    case 180:
      out.append(PdfContents.ROTATE180);
      out.append(page.getRight());
      out.append(' ');
      out.append(page.getTop());
      out.append(PdfContents.ROTATEFINAL);
      break;
    case 270:
      out.append(PdfContents.ROTATE270);
      out.append('0').append(' ');
      out.append(page.getRight());
      out.append(PdfContents.ROTATEFINAL);
      break;
  }
}

代码示例来源:origin: com.itextpdf/itextg

void applyRotation(PdfDictionary pageN, ByteBuffer out) {
  if (!rotateContents)
    return;
  Rectangle page = reader.getPageSizeWithRotation(pageN);
  int rotation = page.getRotation();
  switch (rotation) {
    case 90:
      out.append(PdfContents.ROTATE90);
      out.append(page.getTop());
      out.append(' ').append('0').append(PdfContents.ROTATEFINAL);
      break;
    case 180:
      out.append(PdfContents.ROTATE180);
      out.append(page.getRight());
      out.append(' ');
      out.append(page.getTop());
      out.append(PdfContents.ROTATEFINAL);
      break;
    case 270:
      out.append(PdfContents.ROTATE270);
      out.append('0').append(' ');
      out.append(page.getRight());
      out.append(PdfContents.ROTATEFINAL);
      break;
  }
}

代码示例来源:origin: com.itextpdf/itextpdf

public PdfArray rotateAnnotations(PdfWriter writer, Rectangle pageSize) {
  PdfArray array = new PdfArray();
  int rotation = pageSize.getRotation() % 360;
  int currentPage = writer.getCurrentPageNumber();
  for (int k = 0; k < annotations.size(); ++k) {

代码示例来源:origin: com.itextpdf/itextg

public PdfArray rotateAnnotations(PdfWriter writer, Rectangle pageSize) {
  PdfArray array = new PdfArray();
  int rotation = pageSize.getRotation() % 360;
  int currentPage = writer.getCurrentPageNumber();
  for (int k = 0; k < annotations.size(); ++k) {

代码示例来源:origin: com.itextpdf/itextpdf

void insertPage(int pageNumber, Rectangle mediabox) {
  Rectangle media = new Rectangle(mediabox);
  int rotation = media.getRotation() % 360;
  PdfDictionary page = new PdfDictionary(PdfName.PAGE);
  page.put(PdfName.RESOURCES, new PdfDictionary());

代码示例来源:origin: com.itextpdf/itextg

void insertPage(int pageNumber, Rectangle mediabox) {
  Rectangle media = new Rectangle(mediabox);
  int rotation = media.getRotation() % 360;
  PdfDictionary page = new PdfDictionary(PdfName.PAGE);
  page.put(PdfName.RESOURCES, new PdfDictionary());

代码示例来源:origin: com.itextpdf/itextpdf

int rotation = pageSize.getRotation();
if (rotation == 90 || rotation == 180)
  fith = pageSize.getHeight() - fith;

代码示例来源:origin: com.itextpdf/itextg

int rotation = pageSize.getRotation();
if (rotation == 90 || rotation == 180)
  fith = pageSize.getHeight() - fith;

相关文章