亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > Java > 正文

java使用Jsoup組件生成word文檔

2019-11-26 15:54:41
字體:
來源:轉載
供稿:網友

先利用jsoup將得到的html代碼“標準化”(Jsoup.parse(String html))方法,然后利用FileWiter將此html內容寫到本地的template.doc文件中,此時如果文章中包含圖片的話,template.doc就會依賴你的本地圖片文件路徑,如果你將圖片更改一個名稱或者將路徑更改,再打開這個template.doc,圖片就會顯示不出來(出現一個叉叉)。為了解決此問題,利用jsoup組件循環遍歷html文檔的內容,將img元素替換成${image_自增值}的標識,取出img元素中的src屬性,再以鍵值對的方式存儲起來,例如:

復制代碼 代碼如下:

Map<Integer,String> imgMap = new HashMap<Integer,String>();
imgMap.put(1,”D:/lucene.png”);
 


此時你的html內容會變成如下格式:(舉個示例)
復制代碼 代碼如下:

<html>
 <head></head>
 <body>

  <p>測試消息1</p>
  <p>${image_1}<p>
  <table>
   <tr>
    <td> <td>
   </tr>
  </table>
  <p>測試消息2</p>
  <a href=//www.49028c.com><p>${image_2}</p></a>
  <p>測試消息3</p>
 </body>
</html>

保存到本地文件以后,利用MSOfficeGeneratorUtils類(工具類詳見下面,基于開源組件Jacob)打開你保存的這個template.doc,調用replaceText2Image,將上面代碼的圖片標識替換為圖片,這樣就消除了本地圖片路徑的問題。 然后再調用copy方法,復制整篇文檔,關閉template.doc文件,新建一個doc文件(createDocument),調用 paste方法粘貼你剛復制的template.doc里的內容,保存。基本上就ok了。
關于copy整個word文檔的內容,也會出現一個隱式問題。就是當復制的內容太多時,關閉word程序的時候,會談出一個對話框,問你是否將復制的數據應用于其它的程序。對于這個問題解決方法很簡單,你可以在調用 quit(退出word程序方法)之前,新建一篇文檔,輸入一行字,然后調用 copy方法,對于復制的數據比較少時,關閉word程序時,它不會提示你的。見如下代碼
//復制一個內容比較少的*.doc文檔,防止在關閉word程序時提示有大量的copy內容在內存中,是否應用于其它程序對話框,
復制代碼 代碼如下:

msOfficeUtils.createNewDocument();
msOfficeUtils.insertText("測試消息");
msOfficeUtils.copy();
msOfficeUtils.close();
msOfficeUtils.quit();
Jacob在sourceforge上的鏈接
Jsoup官網
MsOfficeGeneratorUtils
package com.topstar.test;
import java.io.File;
import java.io.IOException;
import java.util.List;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
/**
 * 利用JACOB對Microsoft Office Word 進行相關操作
 *
 * @author xiaowu
 * @category topstar
 * @version 1.0
 * @since 2011-12-5
 */
public class MSOfficeGeneratorUtils {
 /**
  * Microsoft Office Word 程序對象
  */
 private ActiveXComponent word = null;
 /**
  * Word 活動文檔對象
  */
 private Dispatch document = null;
 /**
  * 所有 Word 文檔對象
  */
 private Dispatch documents = null;
 /**
  * selection 代表當前活動文檔窗口中的所選內容。如果文檔中沒有選中任何內容,則此對象代表插入點(即光標所在位置)。<br/>
  * 每個文檔窗口中只能存在一個selection對象,并且在整個應用程序中,只能存在一個活動的selection對象
  */
 private Dispatch selection = null;
 /**
  * range 對象代表文檔中的一個連續的區域。每個range對象由一個起始字符位置與結束字符位置定義。<br/>
  * range 對象獨立于所選內容。你可以定義和處理一個范圍而無需改變所選內容。還可以在文檔中定義多個范圍。但每個文檔中只能有一個所選內容
  */
 private Dispatch range = null;
 /**
  * PageSetup 對象包含文檔所有頁面的設置屬性(如紙張大小,左邊距,下邊距)
  */
 private Dispatch pageSetup = null;
 /**
  * 文檔中的所有表格對象
  */
 private Dispatch tables = null;
 /** 單個表格對象 */
 private Dispatch table = null;
 /** 表格所有行對象 */
 private Dispatch rows = null;
 /** 表格所有列對象 */
 private Dispatch cols = null;
 /** 表格指定行對象 */
 private Dispatch row = null;
 /** 表格指定列對象 */
 private Dispatch col = null;
 /** 表格中指定的單元格 */
 private Dispatch cell = null;
 /** 字體 */
 private Dispatch font = null;
 /** 對齊方式 */
 private Dispatch alignment = null;
 /**
  * 構造方法
  *
  * @param visible
  *            設置在生成word文檔時,程序是否可見
  */
 public MSOfficeGeneratorUtils(boolean visible) {
  if (this.word == null) {
   // 初始化Microsoft Office Word 實例
   this.word = new ActiveXComponent("Word.Application");
   this.word.setProperty("Visible", new Variant(visible));
   // 禁用宏
   this.word.setProperty("AutomationSecurity", new Variant(3));
  }
  if (this.documents == null)
   this.documents = word.getProperty("Documents").toDispatch();
 }
 /**
  * 設置頁面方向與頁邊距
  *
  * @param orientation
  *            頁面方向
  *            <ul>
  *            <li>0 橫向</li>
  *            <li>1 縱向</li>
  *            </ul>
  * @param leftMargin
  *            左邊距
  * @param rightMargin
  *            右邊距
  * @param topMargin
  *            上邊距
  * @param buttomMargin
  *            下邊距
  */
 public void setPageSetup(int orientation, int leftMargin, int rightMargin,
   int topMargin, int buttomMargin) {
  if (this.pageSetup == null)
   this.getPageSetup();
  Dispatch.put(pageSetup, "Orientation", orientation);
  Dispatch.put(pageSetup, "LeftMargin", leftMargin);
  Dispatch.put(pageSetup, "RightMargin", rightMargin);
  Dispatch.put(pageSetup, "TopMargin", topMargin);
  Dispatch.put(pageSetup, "BottomMargin", buttomMargin);
 }
 /**
  * 打開word文檔
  *
  * @param docPath
  *            word文檔路徑
  * @return 打開的文檔對象
  */
 public Dispatch openDocument(String docPath) {
  this.document = Dispatch.call(documents, "Open", docPath).toDispatch();
  this.getSelection();
  this.getRange();
  this.getAlignment();
  this.getFont();
  this.getPageSetup();
  return this.document;
 }
 /**
  * 創建一篇新文檔
  *
  * @return 文檔對象
  */
 public Dispatch createNewDocument() {
  this.document = Dispatch.call(documents, "Add").toDispatch();
  this.getSelection();
  this.getRange();
  this.getPageSetup();
  this.getAlignment();
  this.getFont();
  return this.document;
 }
 /**
  * 獲取選定的內容或插入點
  *
  * @return selection
  */
 public Dispatch getSelection() {
  this.selection = word.getProperty("Selection").toDispatch();
  return this.selection;
 }
 /**
  * 獲取當前文檔中可以修改的部分,前提是必須存在選中內容
  *
  * @return range
  */
 public Dispatch getRange() {
  this.range = Dispatch.get(this.selection, "Range").toDispatch();
  return this.range;
 }
 /**
  * 獲得當前文檔的頁面屬性
  */
 public Dispatch getPageSetup() {
  if (this.document == null)
   return this.pageSetup;
  this.pageSetup = Dispatch.get(this.document, "PageSetup").toDispatch();
  return this.pageSetup;
 }
 /**
  * 把選中內容或插入點向上移動
  *
  * @param count
  *            移動的距離
  */
 public void moveUp(int count) {
  for (int i = 0; i < count; i++)
   Dispatch.call(this.selection, "MoveUp");
 }
 /**
  * 把選中內容或插入點向下移動
  *
  * @param count
  *            移動的距離
  */
 public void moveDown(int count) {
  for (int i = 0; i < count; i++)
   Dispatch.call(this.selection, "MoveDown");
 }
 /**
  * 把選中內容或插入點向左移動
  *
  * @param count
  *            移動的距離
  */
 public void moveLeft(int count) {
  for (int i = 0; i < count; i++)
   Dispatch.call(this.selection, "MoveLeft");
 }
 /**
  * 把選中內容或插入點向右移動
  *
  * @param count
  *            移動的距離
  */
 public void moveRight(int count) {
  for (int i = 0; i < count; i++)
   Dispatch.call(this.selection, "MoveRight");
 }
 /**
  * 執行硬換行(回車鍵)
  *
  * @param count
  *            換行數
  */
 public void enterDown(int count) {
  for (int i = 0; i < count; i++)
   Dispatch.call(this.selection, "TypeParagraph");
 }
 /**
  * 把插入點移動到文件首位置
  */
 public void moveStart() {
  Dispatch.call(this.selection, "HomeKey", new Variant(6));
 }
 /**
  * 把插入點移動到文件末尾
  */
 public void moveEnd() {
  Dispatch.call(selection, "EndKey", new Variant(6));
 }

 
 /**
  * 從選定內容或插入點開始查找文本
  *
  * @param toFindText
  *            要查找的內容
  * @return 查詢到的內容并選中
  */
 public boolean find(String toFindText) {
  // 從selection所在位置開始查詢
  Dispatch find = Dispatch.call(this.selection, "Find").toDispatch();
  // 設置要查找的?熱?br />   Dispatch.put(find, "Text", toFindText);
  // 向前查找
  Dispatch.put(find, "Forward", "True");
  // 設置格式
  Dispatch.put(find, "Format", "True");
  // 大小寫匹配
  Dispatch.put(find, "MatchCase", "True");
  // 全字匹配
  Dispatch.put(find, "MatchWholeWord", "True");
  // 查找并選中
  return Dispatch.call(find, "Execute").getBoolean();
 }
 /**
  * 替換選定的內容
  *
  * @param newText
  *            要替換的內容
  */
 public void replace(String newText) {
  // 設置替換文本
  Dispatch.put(this.selection, "Text", newText);
 }
 /**
  * 全局替換
  *
  * @param oldText
  *            要替換的內容
  * @param replaceObj
  *            被替換的內容
  */
 public void replaceAll(String oldText, Object replaceObj) {
  // 將插入點移到文件開頭
  moveStart();
  // 表格替換方式
  String newText = (String) replaceObj;
  // 圖片替換方式
  if (oldText.indexOf("image") != -1 || newText.lastIndexOf(".bmp") != -1 || newText.lastIndexOf(".jpg") != -1 || newText.lastIndexOf(".gif") != -1) {
   while (find(oldText)) {
    insertImage(newText);
    Dispatch.call(this.selection, "MoveRight");
   }
   // 文本方式
  } else {
   while (find(oldText)) {
    replace(newText);
    Dispatch.call(this.selection, "MoveRight");
   }
  }
 }

 /**
  * 將指定的內容替換成圖片
  * @param replaceText 指定的內容
  * @param imgPath 圖片路徑
  */
 public void replaceText2Image(String replaceText,String imgPath){
  moveStart();
  while(find(replaceText)){
   insertImage(imgPath);
   moveEnd();
   enterDown(1);
  }
 }
 /**
  * 向當前插入點替換圖片
  *
  * @param imagePath
  *            圖片的路徑
  */
 public void insertImage(String imagePath) {
  Dispatch.call(Dispatch.get(selection, "InLineShapes").toDispatch(), "AddPicture", imagePath);
 }
 /**
  * 合并單元格
  *
  * @param tableIndex
  *            表格下標,從1開始
  * @param fstCellRowIdx
  *            開始行
  * @param fstCellColIdx
  *            開始列
  * @param secCellRowIdx
  *            結束行
  * @param secCellColIdx
  *            結束列
  */
 public void mergeCell(int tableIndex, int fstCellRowIdx, int fstCellColIdx,
   int secCellRowIdx, int secCellColIdx) {
  getTable(tableIndex);
  Dispatch fstCell = Dispatch.call(table, "Cell",
    new Variant(fstCellRowIdx), new Variant(fstCellColIdx))
    .toDispatch();
  Dispatch secCell = Dispatch.call(table, "Cell",
    new Variant(secCellRowIdx), new Variant(secCellColIdx))
    .toDispatch();
  Dispatch.call(fstCell, "Merge", secCell);
 }
 /**
  * 拆分當前單元格
  *
  * @param numRows
  *            拆分的行數,如果不想拆分行,請指定為1
  * @param numColumns
  *            拆分的列數,如果不想拆分列,請指定為1
  */
 public void splitCell(int numRows, int numColumns) {
  Dispatch.call(this.cell, "Split", new Variant(numRows), new Variant(
    numColumns));
 }
 /**
  * 向表格中寫入內容
  *
  * @param list
  *            要寫入的內容<br/>
  *            注:list.size() 應該與表格的rows一致,String數組的length屬性應與表格的columns一致
  */
 public void insertToTable(List<String[]> list) {
  if (list == null || list.size() <= 0)
   return;
  if (this.table == null)
   return;
  for (int i = 0; i < list.size(); i++) {
   String[] strs = list.get(i);
   for (int j = 0; j < strs.length; j++) {
    // 遍歷表格中每一??單元格,遍歷次數所要填入的?熱菔?肯嗤?br />     Dispatch cell = this.getCell(i + 1, j + 1);
    // 選中此單元格
    Dispatch.call(cell, "Select");
    // 寫入?熱蕕醬說ピ?裰?br />     Dispatch.put(this.selection, "Text", strs[j]);
    // 將插入點移動至下一??位置
   }
   this.moveDown(1);
  }
  // 換行
  this.enterDown(1);
 }
 /**
  * 向當前插入點插入文本內容
  *
  * @param list
  *            要插入的內容,list.size()代表行數
  */
 public void insertToDocument(List<String> list) {
  if (list == null || list.size() <= 0)
   return;
  if (this.document == null)
   return;
  for (String str : list) {
   Dispatch.put(this.selection, "Text", str);
   this.moveDown(1);
   this.enterDown(1);
  }
 }
 /**
  * 在當前插入點插入文本
  *
  * @param insertText
  *            要插入的文本
  */
 public void insertToText(String insertText) {
  Dispatch.put(this.selection, "Text", insertText);
 }
 /**
  * 在當前插入點插入字符串,利用此方法插入一行text后,Word會默認選中它,如果再調用此方法,會將原來的內容覆蓋掉,所以調用此方法后,記得調用moveRight,將偏移量向右邊移動一個位置 。
  * @param newText 要插入的新字符串
  */
 public void insertText(String newText) {
  Dispatch.put(selection, "Text", newText);
 }
 /**
  * 創建新的表格
  *
  * @param rowCount
  *            行
  * @param colCount
  *            列
  * @param width
  *            表格邊框
  *            <ul>
  *            <li>0 無邊框</li>
  *            <li>1 有邊框</li>
  *            </ul>
  * @return 表格對象
  */
 public Dispatch createNewTable(int rowCount, int colCount, int width) {
  if (this.tables == null)
   this.getTables();
  this.getRange();
  if (rowCount > 0 && colCount > 0)
   this.table = Dispatch.call(this.tables, "Add", this.range,
     new Variant(rowCount), new Variant(colCount),
     new Variant(width)).toDispatch();
  return this.table;
 }
 /**
  * 獲取當前document對象中的所有表格對象
  *
  * @return tables
  */
 public Dispatch getTables() {
  if (this.document == null)
   return this.tables;
  this.tables = Dispatch.get(this.document, "Tables").toDispatch();
  return this.tables;
 }
 /**
  * 獲取當前文檔中的所有表格數量
  *
  * @return 表格數量
  */
 public int getTablesCount() {
  if (this.tables == null)
   this.getTables();
  return Dispatch.get(tables, "Count").getInt();
 }
 /**
  * 根據索引獲得table對象
  *
  * @param tableIndex
  *            索引
  * @return table
  */
 public Dispatch getTable(int tableIndex) {
  if (this.tables == null)
   this.getTables();
  if (tableIndex >= 0)
   this.table = Dispatch.call(this.tables, "Item", new Variant(tableIndex)).toDispatch();
  return this.table;
 }
 /**
  * 在指定的單元格里填寫數據
  *
  * @param tableIndex
  *            表格索引
  * @param cellRowIdx
  *            行索引
  * @param cellColIdx
  *            列索引
  * @param txt
  *            文本
  */
 public void putTxtToCell(int tableIndex, int cellRowIdx, int cellColIdx, String txt) {
  getTable(tableIndex);
  getCell(cellRowIdx, cellColIdx);
  Dispatch.call(this.cell, "Select");
  Dispatch.put(this.selection, "Text", txt);
 }
 /**
  * 在當前文檔末尾拷貝來自另一個文檔中的段落
  *
  * @param anotherDocPath
  *            另一個文檔的磁盤路徑
  * @param tableIndex
  *            被拷貝的段落在另一格文檔中的序號(從1開始)
  */
 public void copyParagraphFromAnotherDoc(String anotherDocPath, int paragraphIndex) {
  Dispatch wordContent = Dispatch.get(this.document, "Content").toDispatch(); // 取得當前文檔的內容
  Dispatch.call(wordContent, "InsertAfter", "$selection$");// 插入特殊符定位插入點
  copyParagraphFromAnotherDoc(anotherDocPath, paragraphIndex, "$selection$");
 }
 /**
  * 在當前文檔指定的位置拷貝來自另一個文檔中的段落
  *
  * @param anotherDocPath
  *            另一個文檔的磁盤路徑
  * @param tableIndex
  *            被拷貝的段落在另一格文檔中的序號(從1開始)
  * @param pos
  *            當前文檔指定的位置
  */
 public void copyParagraphFromAnotherDoc(String anotherDocPath, int paragraphIndex, String pos) {
  Dispatch doc2 = null;
  try {
   doc2 = Dispatch.call(documents, "Open", anotherDocPath).toDispatch();
   Dispatch paragraphs = Dispatch.get(doc2, "Paragraphs").toDispatch();
   Dispatch paragraph = Dispatch.call(paragraphs, "Item", new Variant(paragraphIndex)).toDispatch();
   Dispatch range = Dispatch.get(paragraph, "Range").toDispatch();
   Dispatch.call(range, "Copy");
   if (this.find(pos)) {
    getRange();
    Dispatch.call(this.range, "Paste");
   }
  } catch (Exception e) {
   e.printStackTrace();
  } finally {
   if (doc2 != null) {
    Dispatch.call(doc2, "Close", new Variant(true));
    doc2 = null;
   }
  }
 }
 /**
  * 在當前文檔指定的位置拷貝來自另一個文檔中的表格
  *
  * @param anotherDocPath
  *            另一個文檔的磁盤路徑
  * @param tableIndex
  *            被拷貝的表格在另一格文檔中的序號(從1開始)
  * @param pos
  *            當前文檔指定的位置
  */
 public void copyTableFromAnotherDoc(String anotherDocPath, int tableIndex,
   String pos) {
  Dispatch doc2 = null;
  try {
   doc2 = Dispatch.call(documents, "Open", anotherDocPath)
     .toDispatch();
   Dispatch tables = Dispatch.get(doc2, "Tables").toDispatch();
   Dispatch table = Dispatch.call(tables, "Item",
     new Variant(tableIndex)).toDispatch();
   Dispatch range = Dispatch.get(table, "Range").toDispatch();
   Dispatch.call(range, "Copy");
   if (this.find(pos)) {
    getRange();
    Dispatch.call(this.range, "Paste");
   }
  } catch (Exception e) {
   e.printStackTrace();
  } finally {
   if (doc2 != null) {
    Dispatch.call(doc2, "Close", new Variant(true));
    doc2 = null;
   }
  }
 }
 /**
  * 在當前文檔指定的位置拷貝來自另一個文檔中的圖片
  *
  * @param anotherDocPath
  *            另一個文檔的磁盤路徑
  * @param shapeIndex
  *            被拷貝的圖片在另一格文檔中的位置
  * @param pos
  *            當前文檔指定的位置
  */
 public void copyImageFromAnotherDoc(String anotherDocPath, int shapeIndex,
   String pos) {
  Dispatch doc2 = null;
  try {
   doc2 = Dispatch.call(documents, "Open", anotherDocPath)
     .toDispatch();
   Dispatch shapes = Dispatch.get(doc2, "InLineShapes").toDispatch();
   Dispatch shape = Dispatch.call(shapes, "Item",
     new Variant(shapeIndex)).toDispatch();
   Dispatch imageRange = Dispatch.get(shape, "Range").toDispatch();
   Dispatch.call(imageRange, "Copy");
   if (this.find(pos)) {
    getRange();
    Dispatch.call(this.range, "Paste");
   }
  } catch (Exception e) {
   e.printStackTrace();
  } finally {
   if (doc2 != null) {
    Dispatch.call(doc2, "Close", new Variant(true));
    doc2 = null;
   }
  }
 }
 /**
  * 在指定的表格的指定行前面增加行
  *
  * @param tableIndex
  *            word文件中的第N張表(從1開始)
  * @param rowIndex
  *            指定行的序號(從1開始)
  */
 public void addTableRow(int tableIndex, int rowIndex) {
  getTable(tableIndex);
  getTableRows();
  getTableRow(rowIndex);
  Dispatch.call(this.rows, "Add", new Variant(this.row));
 }
 /**
  * 在第1行前增加一行
  *
  * @param tableIndex
  *            word文檔中的第N張表(從1開始)
  */
 public void addFirstTableRow(int tableIndex) {
  getTable(tableIndex);
  getTableRows();
  Dispatch row = Dispatch.get(rows, "First").toDispatch();
  Dispatch.call(this.rows, "Add", new Variant(row));
 }
 /**
  * 在最后1行前增加一行
  *
  * @param tableIndex
  *            word文檔中的第N張表(從1開始)
  */
 public void addLastTableRow(int tableIndex) {
  getTable(tableIndex);
  getTableRows();
  Dispatch row = Dispatch.get(this.rows, "Last").toDispatch();
  Dispatch.call(this.rows, "Add", new Variant(row));
 }
 /**
  * 增加一行
  *
  * @param tableIndex
  *            word文檔中的第N張表(從1開始)
  */
 public void addRow(int tableIndex) {
  getTable(tableIndex);
  getTableRows();
  Dispatch.call(this.rows, "Add");
 }
 /**
  * 增加一列
  *
  * @param tableIndex
  *            word文檔中的第N張表(從1開始)
  */
 public void addCol(int tableIndex) {
  getTable(tableIndex);
  getTableColumns();
  Dispatch.call(this.cols, "Add").toDispatch();
  Dispatch.call(this.cols, "AutoFit");
 }
 /**
  * 在指定列前面增加表格的列
  *
  * @param tableIndex
  *            word文檔中的第N張表(從1開始)
  * @param colIndex
  *            指定列的序號 (從1開始)
  */
 public void addTableCol(int tableIndex, int colIndex) {
  getTable(tableIndex);
  getTableColumns();
  getTableColumn(colIndex);
  Dispatch.call(this.cols, "Add", this.col).toDispatch();
  Dispatch.call(this.cols, "AutoFit");
 }
 /**
  * 在第1列前增加一列
  *
  * @param tableIndex
  *            word文檔中的第N張表(從1開始)
  */
 public void addFirstTableCol(int tableIndex) {
  getTable(tableIndex);
  Dispatch cols = getTableColumns();
  Dispatch col = Dispatch.get(cols, "First").toDispatch();
  Dispatch.call(cols, "Add", col).toDispatch();
  Dispatch.call(cols, "AutoFit");
 }
 /**
  * 在最后一列前增加一列
  *
  * @param tableIndex
  *            word文檔中的第N張表(從1開始)
  */
 public void addLastTableCol(int tableIndex) {
  getTable(tableIndex);
  Dispatch cols = getTableColumns();
  Dispatch col = Dispatch.get(cols, "Last").toDispatch();
  Dispatch.call(cols, "Add", col).toDispatch();
  Dispatch.call(cols, "AutoFit");
 }
 /**
  * 獲取當前表格的列數
  *
  * @return 列總數
  */
 public int getTableColumnsCount() {
  if (this.table == null)
   return 0;
  return Dispatch.get(this.cols, "Count").getInt();
 }
 /**
  * 獲取當前表格的行數
  *
  * @return 行總數
  */
 public int getTableRowsCount() {
  if (this.table == null)
   return 0;
  return Dispatch.get(this.rows, "Count").getInt();
 }
 /**
  * 獲取當前表格的所有列對象
  *
  * @return cols
  */
 public Dispatch getTableColumns() {
  if (this.table == null)
   return this.cols;
  this.cols = Dispatch.get(this.table, "Columns").toDispatch();
  return this.cols;
 }
 /**
  * 獲取當前表格的所有行對象
  *
  * @return rows
  */
 public Dispatch getTableRows() {
  if (this.table == null)
   return this.rows;
  this.rows = Dispatch.get(this.table, "Rows").toDispatch();
  return this.rows;
 }
 /**
  * 根據索引獲得當前表格的列對象
  *
  * @param columnIndex
  *            列索引
  * @return col
  */
 public Dispatch getTableColumn(int columnIndex) {
  if (this.cols == null)
   this.getTableColumns();
  if (columnIndex >= 0)
   this.col = Dispatch.call(this.cols, "Item",
     new Variant(columnIndex)).toDispatch();
  return this.col;
 }
 /**
  * 根據索引獲得當前表格的行對象
  *
  * @param rowIndex
  *            行索引
  * @return row
  */
 public Dispatch getTableRow(int rowIndex) {
  if (this.rows == null)
   this.getTableRows();
  if (rowIndex >= 0)
   this.row = Dispatch.call(this.rows, "Item", new Variant(rowIndex))
     .toDispatch();
  return this.row;
 }
 /**
  * 自動調整當前所有表格
  */
 public void autoFitTable() {
  int count = this.getTablesCount();
  for (int i = 0; i < count; i++) {
   Dispatch table = Dispatch.call(tables, "Item", new Variant(i + 1))
     .toDispatch();
   Dispatch cols = Dispatch.get(table, "Columns").toDispatch();
   Dispatch.call(cols, "AutoFit");
  }
 }
 /**
  * 根據行索引與列索引獲取當前表格中的單元格
  *
  * @param cellRowIdx
  *            行索引
  * @param cellColIdx
  *            列索引
  * @return cell對象
  */
 public Dispatch getCell(int cellRowIdx, int cellColIdx) {
  if (this.table == null)
   return this.cell;
  if (cellRowIdx >= 0 && cellColIdx >= 0)
   this.cell = Dispatch.call(this.table, "Cell",
     new Variant(cellRowIdx), new Variant(cellColIdx))
     .toDispatch();
  return this.cell;
 }
 public void selectCell(int cellRowIdx, int cellColIdx) {
  if (this.table == null)
   return;
  getCell(cellRowIdx, cellColIdx);
  if (cellRowIdx >= 0 && cellColIdx >= 0)
   Dispatch.call(this.cell, "select");
 }
 /**
  * 設置當前文檔的標題
  *
  * @param title 標題
  * @param alignmentType 對齊方式
  * @see setAlignment
  */
 public void setTitle(String title, int alignmentType) {
  if (title == null || "".equals(title))
   return;
  if (this.alignment == null)
   this.getAlignment();
  if(alignmentType != 0 && alignmentType != 1 && alignmentType != 2)
   alignmentType = 0;
  Dispatch.put(this.alignment, "Alignment", alignmentType);
  Dispatch.call(this.selection, "TypeText", title);
 }
 /**
  * 設置當前表格邊框的粗細
  *
  * @param width
  *            范圍:1 < w < 13, 如果是0,就代表?]有框<br/>
  */
 public void setTableBorderWidth(int width) {
  if (this.table == null)
   return;
  /*
   * 設置表格線的粗細 1:代表最上邊一條線 2:代表最左邊一條線 3:最下邊一條線 4:最右邊一條線 5:除最上邊最下邊之外的所有橫線
   * 6:除最左邊最右邊之外的所有豎線 7:從左上角到右下角的斜線 8:從左下角到右上角的斜線
   */
  Dispatch borders = Dispatch.get(table, "Borders").toDispatch();
  Dispatch border = null;
  for (int i = 1; i < 7; i++) {
   border = Dispatch.call(borders, "Item", new Variant(i))
     .toDispatch();
   if (width != 0) {
    Dispatch.put(border, "LineWidth", new Variant(width));
    Dispatch.put(border, "Visible", new Variant(true));
   } else if (width == 0) {
    Dispatch.put(border, "Visible", new Variant(false));
   }
  }
 }
 /**
  * 得到指定的表格指定的單元格中的值
  *
  * @param tableIndex
  *            表格索引(從1開始)
  * @param rowIndex
  *            行索引(從1開始)
  * @param colIndex
  *            列索引(從1開始)
  * @return
  */
 public String getTxtFromCell(int tableIndex, int rowIndex, int colIndex) {
  String value = "";
  // 設置為當前表格
  getTable(tableIndex);
  getCell(rowIndex, colIndex);
  if (cell != null) {
   Dispatch.call(cell, "Select");
   value = Dispatch.get(selection, "Text").toString();
   value = value.substring(0, value.length() - 2); // 去掉最后的回車符;
  }
  return value;
 }
 /**
  * 對當前選中的內容設置項目符號與列表
  *
  * @param tabIndex
  *            <ul>
  *            <li>1.項目編號</li>
  *            <li>2.編號</li>
  *            <li>3.多級編號</li>
  *            <li>4.列表樣式</li>
  *            </ul>
  * @param index
  *            0表示沒有,其它數字代表是該tab頁中的第幾項內容
  */
 public void applyListTemplate(int tabIndex, int index) {
  // 取得ListGalleries對象列表
  Dispatch listGalleries = Dispatch.get(this.word, "ListGalleries")
    .toDispatch();
  // 取得列表中一個對象
  Dispatch listGallery = Dispatch.call(listGalleries, "Item",
    new Variant(tabIndex)).toDispatch();
  Dispatch listTemplates = Dispatch.get(listGallery, "ListTemplates")
    .toDispatch();
  if (this.range == null)
   this.getRange();
  Dispatch listFormat = Dispatch.get(this.range, "ListFormat")
    .toDispatch();
  Dispatch.call(listFormat, "ApplyListTemplate",
    Dispatch.call(listTemplates, "Item", new Variant(index)),
    new Variant(true), new Variant(1), new Variant(0));
 }
 /**
  * 增加文檔目錄
  */
 public void addTablesOfContents() {
  // 取得ActiveDocument、TablesOfContents、range對象
  Dispatch ActiveDocument = word.getProperty("ActiveDocument")
    .toDispatch();
  Dispatch TablesOfContents = Dispatch.get(ActiveDocument,
    "TablesOfContents").toDispatch();
  Dispatch range = Dispatch.get(this.selection, "Range").toDispatch();
  // 增加目錄
  Dispatch.call(TablesOfContents, "Add", range, new Variant(true),
    new Variant(1), new Variant(3), new Variant(true), new Variant(
      ""), new Variant(true), new Variant(true));
 }
 /**
  * 設置當前selection對齊方式
  *
  * @param alignmentType
  *            <ul>
  *            <li>0.居左</li>
  *            <li>1.居中</li>
  *            <li>2.居右</li>
  *            </ul>
  */
 public void setAlignment(int alignmentType) {
  if (this.alignment == null)
   this.getAlignment();
  Dispatch.put(this.alignment, "Alignment", alignmentType);
 }
 /**
  * 獲取當前selection的對齊方式
  *
  * @return alignment
  */
 public Dispatch getAlignment() {
  if (this.selection == null)
   this.getSelection();
  this.alignment = Dispatch.get(this.selection, "ParagraphFormat")
    .toDispatch();
  return this.alignment;
 }
 /**
  * 獲取字體對象
  *
  * @return font
  */
 public Dispatch getFont() {
  if (this.selection == null)
   this.getSelection();
  this.font = Dispatch.get(this.selection, "Font").toDispatch();
  return this.font;
 }
 /**
  * 設置當前selection的字體
  *
  * @param fontName
  *            字體名稱,如“微軟雅黑”
  * @param isBold
  *            是否粗體
  * @param isItalic
  *            是否斜體
  * @param isUnderline
  *            是否下劃線
  * @param rgbColor
  *            顏色值"1,1,1,1"
  * @param Scale
  *            字體間距
  * @param fontSize
  *            字體大小
  */
 @Deprecated
 public void setFontScale(String fontName, boolean isBold, boolean isItalic,
   boolean isUnderline, String rgbColor, int Scale, int fontSize) {
  Dispatch.put(this.font, "Name", fontName);
  Dispatch.put(this.font, "Bold", isBold);
  Dispatch.put(this.font, "Italic", isItalic);
  Dispatch.put(this.font, "Underline", isUnderline);
  Dispatch.put(this.font, "Color", rgbColor);
  Dispatch.put(this.font, "Scaling", Scale);
  Dispatch.put(this.font, "Size", fontSize);
 }

 
 /**
 * 設置當前選定內容的字體
 * @param isBold 是否為粗體
 * @param isItalic 是否為斜體
 * @param isUnderLine 是否帶下劃線
 * @param color rgb 字體顏色 例如:紅色 255,0,0
 * @param size 字體大小  12:小四  16:三號
 * @param name 字體名稱  例如:宋體,新宋體,楷體,隸書
 */
 public void setFont(boolean isBold,boolean isItalic,boolean isUnderLine,String color,String size,String name) {
    Dispatch font = Dispatch.get(getSelection(), "Font").toDispatch();
    Dispatch.put(font, "Name", new Variant(name));
    Dispatch.put(font, "Bold", new Variant(isBold));
    Dispatch.put(font, "Italic", new Variant(isItalic));
    Dispatch.put(font, "Underline", new Variant(isUnderLine));
    if(!"".equals(color))
     Dispatch.put(font, "Color", color);
    Dispatch.put(font, "Size", size);
 }

 /**
  * 保存文件
  *
  * @param outputPath
  *            保存路徑
  */
 public void saveAs(String outputPath) {
  if (this.document == null)
   return;
  if (outputPath == null || "".equals(outputPath))
   return;
  Dispatch.call(this.document, "SaveAs", outputPath);
 }
 /**
  * 另存為HTML內容
  *
  * @param htmlFile
  *            html文件路徑
  */
 public void saveAsHtml(String htmlFile) {
  Dispatch.invoke(this.document, "SaveAs", Dispatch.Method, new Object[] {
    htmlFile, new Variant(8) }, new int[1]);
 }
 /**
  * saveFormat | Member name Description 0 | wdFormatDocument Microsoft Word
  * format. 1 | wdFormatTemplate Microsoft Word template format. 2 |
  * wdFormatText Microsoft Windows text format. 3 | wdFormatTextLineBreaks
  * Microsoft Windows text format with line breaks preserved. 4 |
  * wdFormatDOSText Microsoft DOS text format. 5 | wdFormatDOSTextLineBreaks
  * Microsoft DOS text with line breaks preserved. 6 | wdFormatRTF Rich text
  * format (RTF). 7 | wdFormatEncodedText Encoded text format. 7 |
  * wdFormatUnicodeText Unicode text format. 8 | wdFormatHTML Standard HTML
  * format. 9 | wdFormatWebArchive Web archive format. 10 |
  * wdFormatFilteredHTML Filtered HTML format. 11 | wdFormatXML Extensible
  * Markup Language (XML) format.
  */
 /**
  * 關閉當前word文檔
  */
 public void close() {
  if (document == null)
   return;
  Dispatch.call(document, "Close", new Variant(0));
 }
 /**
  * 執行當前文檔打印命令
  */
 public void printFile() {
  if (document == null)
   return;
  Dispatch.call(document, "PrintOut");
 }
 /**
  * 退出Microsoft Office Word程序
  */
 public void quit() {
  word.invoke("Quit", new Variant[0]);
  ComThread.Release();
 }

 /**
  * 選中整篇文檔
  */
 public void selectAllContent(){
  Dispatch.call(this.document,"select");
 }

 /**
  * 復制整篇文檔
  * @param target
  */
 public void copy(){
  Dispatch.call(this.document,"select");
  Dispatch.call(this.selection,"copy");
 }

 /**
  * 在當前插入點位置粘貼選中的內容
  */
 public void paste(){
  Dispatch.call(this.selection,"paste");
 }

 public static void main(String[] args) throws IOException {
  MSOfficeGeneratorUtils officeUtils = new MSOfficeGeneratorUtils(true);
//  officeUtils.openDocument("D:/TRS/TRSWCMV65HBTCIS/Tomcat/webapps/wcm/eipv65/briefreport/templates/zhengfa/頭部.doc");
//  officeUtils.replaceAll("${briefreport_year}", "2011");
//  officeUtils.replaceAll("${briefreport_issue}", "3");
//  File file = File.createTempFile("test", ".tmp");
//  System.out.println(file.getAbsolutePath());
//  file.delete();
//  File file = new File("C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/test5411720146039914615.tmp");
//  System.out.println(file.exists());

  officeUtils.createNewDocument();
//  officeUtils.createNewTable(1, 1, 1);
//  officeUtils.insertText("發表時間:2011-11-11");
//  officeUtils.moveRight(1);
//  officeUtils.insertText("t");
//  officeUtils.moveRight(1);
//  officeUtils.insertText("所在頻道:宏觀環境/社會環境");
//  officeUtils.moveRight(1);
//  officeUtils.insertText("t");
//  officeUtils.moveRight(1);
//  officeUtils.insertText("文章作者:楊葉茂");
//  officeUtils.moveRight(1);
  officeUtils.insertText("I'm Chinese");
  officeUtils.moveRight(1);
  officeUtils.enterDown(1);
  officeUtils.insertText("I'm not Chinese");
  officeUtils.moveRight(1);

 
/*  doc2 = Dispatch.call(documents, "Open", anotherDocPath).toDispatch();
  Dispatch paragraphs = Dispatch.get(doc2, "Paragraphs").toDispatch();
  Dispatch paragraph = Dispatch.call(paragraphs, "Item", new Variant(paragraphIndex)).toDispatch();*/

  // officeUtils.setFontScale("微軟雅黑", true, true, true, "1,1,1,1", 100,
  // 18);
  // officeUtils.setAlignment(1);
  // officeUtils.insertToText("這是一個測試");
  // officeUtils.moveEnd();
  // officeUtils.setFontScale("微軟雅黑", false, false, false, "1,1,1,1", 100,
  // 18);
  // officeUtils.insertImage("d:/11.jpg");
  // officeUtils.enterDown(1);
  // officeUtils.insertToText("這是我的照片");
  // officeUtils.enterDown(1);
  // officeUtils.createNewTable(3, 5, 1);
  // List<String[]> list = new ArrayList<String[]>();
  // for (int i = 0; i < 3; i++) {
  // String[] strs = new String[5];
  // for (int j = 0; j < 5; j++) {
  // strs[j] = j + i + "";
  // }
  // list.add(strs);
  // }
  // officeUtils.insertToTable(list);
  // officeUtils.createNewTable(10, 10, 1);
  // officeUtils.moveEnd();
  // officeUtils.enterDown(1);
  // officeUtils.createNewTable(3,2,1);
  // officeUtils.mergeCell(1, 1, 7, 1, 9);
  // officeUtils.mergeCell(1, 2, 2, 3, 7);
  // officeUtils.mergeCell(1, 3, 4, 9, 10);
  // officeUtils.insertText("123");
  // officeUtils.getCell(1, 2);
  // officeUtils.splitCell(2 , 4);
  // officeUtils.selectCell(1, 2);
  // officeUtils.insertText("split");
  // officeUtils.selectCell(1, 5);
  // officeUtils.insertText("split1");
  // officeUtils.selectCell(1, 6);
  // officeUtils.insertText("yy");
  // officeUtils.selectCell(2, 4);
  // officeUtils.insertText("ltg");
  // officeUtils.saveAs("D:/" + System.currentTimeMillis() + ".doc");
//  officeUtils.close();
//  officeUtils.quit();
 }
}
 TestJsoupComponent
package com.topstar.test;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import com.eprobiti.trs.TRSException;
/** * 基本思路:得到html內容,因為是非標準的html內容,利用Jsoup組件將讀取出來的內容轉換為標準的html文件內容,
 * 然后遍歷每個節點,找到img標簽,記錄其索引,再根據其文件名規則拼接出圖片的物理路徑,將其替換為${image_index}標識,而后將{索引,路徑}
 * 以鍵值對的方式豐入Map中, 如
 * "${image_1,d:lucene.png}"格式,然后利用jacob組件打開template.doc,選中整篇文檔并復制,而后新建一篇文檔,粘貼剛復制的內
 * 容 查找圖片標識位,將其替換為圖片
 *
 * @since 2011-12-09
 * @author xioawu
 * @cateogry topstar
 * @version 1.0
 */
public class TestJsoupComponent {
 private static Document document;
 private static Map<String, String> imgMap = new HashMap<String, String>(); //存放圖片標識符及物理路徑 i.e {"image_1","D:/lucene.png"};
 private static List<String> files = new ArrayList<String>(); //存入本地生成的各個文章doc的文件名
 private static Integer imgIndex = 1; //圖片標識
 public static void main(String[] args) throws TRSException, IOException {
  MSOfficeGeneratorUtils officeUtils = new MSOfficeGeneratorUtils(true); // 將生成過程設置為不可見

  String html = "<html>.....</html>";// 得到正文內容 , 此處自己填寫html內容
  String header = "測試標題"; // 得到文章標題
  document = Jsoup.parse(html);
  // System.out.println(document.html());
  for (Element element : document.body().select("body > *"))
   // 遞歸遍歷body下的所有直接子元素,找出img標簽,@see SysElementText Method
   sysElementText(element);
  File file = new File("D:" + File.separator + "template.doc");
  file.createNewFile(); // 創建模板html
  FileWriter fw = new FileWriter(file);
  fw.write(document.html(), 0, document.html().length());// 寫入文件
  fw.flush(); // 清空FileWriter緩沖區
  fw.close();
  officeUtils.openDocument("D:/template.doc"); // 打開template.doc .由trsserver eipdocument庫中的dochtmlcon生成的template.doc文件
  officeUtils.copy(); // 拷貝整篇文檔
  officeUtils.close();
  officeUtils.createNewDocument();
  officeUtils.paste(); // 粘貼整篇文檔
  for (Entry<String, String> entry : imgMap.entrySet())   //循環將圖片標識位替換成圖片
   officeUtils.replaceText2Image(entry.getKey(), entry.getValue());
  officeUtils.moveStart(); // 將插入點移動至Word文檔的最頂點
  officeUtils.setFont(true, false, false, "0,0,0", "20", "宋體"); // 設置字體,具體參數,自己看API
  officeUtils.setTitle(header, 1); // 設置標題
  officeUtils.enterDown(1); // 設置一行回車
  String filename = UUID.randomUUID().toString();
  files.add(filename); // 記錄文件名,
  officeUtils.saveAs("D:" + File.separator + filename + ".doc"); // 生成D:/UUID.doc文件,利用UUID防止同名
  officeUtils.close(); // 關閉Office Word創建的文檔
  officeUtils.quit(); // 退出Office Word程序
  MSOfficeGeneratorUtils msOfficeUtils = new MSOfficeGeneratorUtils(false); // 整合過程設置為可見
  msOfficeUtils.createNewDocument();
  msOfficeUtils.saveAs("D:" + File.separator + "complete.doc");
  msOfficeUtils.close();
  for (String fileName : files) {
   msOfficeUtils.openDocument("D:" + File.separator + fileName + ".doc");
   msOfficeUtils.copy();
   msOfficeUtils.close();
   msOfficeUtils.openDocument("D:" + File.separator + "complete.doc");
   msOfficeUtils.moveEnd();
   msOfficeUtils.enterDown(1);
   msOfficeUtils.paste();
   msOfficeUtils.saveAs("D:" + File.separator + "complete.doc");
   msOfficeUtils.close();
  }
  //復制一個內容比較少的*.doc文檔,防止在關閉word程序時提示有大量的copy內容在內存中,是否應用于其它程序對話框,
  msOfficeUtils.createNewDocument();
  msOfficeUtils.insertText("測試消息");
  msOfficeUtils.copy();
  msOfficeUtils.close();
  msOfficeUtils.quit();
  imgIndex = 1;
  imgMap.clear();
 }
 public static void sysElementText(Node node) {
  if (node.childNodes().size() == 0) {
   if (node.nodeName().equals("img")) { // 處理圖片路徑問題
    node.after("<p>${image_" + imgIndex + "}</p>"); // 為img添加同級P標簽,內容為<P>${image_imgIndexNumber}</P>
    String src = node.attr("src");
    node.remove(); // 刪除Img標簽。
    StringBuffer imgUrl = new StringBuffer("D:/TRS/TRSWCMV65HBTCIS/WCMData/webpic/"); // 暫時將路徑直接寫死,正式應用上應將此處改寫為WebPic的配置項
    imgUrl.append(src.substring(0, 8)).append("/").append(src.subSequence(0, 10)).append("/").append(src);
    // node.attr("src", imgUrl.toString()); //這一句沒有必要,因為此img標簽已經移除了
    imgMap.put("${image_" + imgIndex++ + "}", imgUrl.toString());
   }
  } else {
   for (Node rNode : node.childNodes()) {
    sysElementText(rNode);
   }
  }
 }
}
 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
国产精品看片资源| 午夜精品在线视频| 欧美精品精品精品精品免费| 欧美日韩美女在线| 操91在线视频| 日韩精品高清在线| 国产精品伦子伦免费视频| 欧美亚洲国产另类| 136fldh精品导航福利| 国产精品美腿一区在线看| 成人在线视频网站| 久久精品欧美视频| 欧美电影在线观看网站| 亚洲香蕉av在线一区二区三区| 中文字幕欧美日韩在线| 国产精品网站入口| 国产欧美在线播放| 久久久久久高潮国产精品视| 久久人人爽亚洲精品天堂| 国产精品旅馆在线| 国产精品日韩精品| 国产精品国产自产拍高清av水多| 狠狠色噜噜狠狠狠狠97| 色99之美女主播在线视频| 日韩在线视频网站| 日韩大陆欧美高清视频区| 国内精品免费午夜毛片| 91成人在线观看国产| 国产91精品久久久久久久| 91在线高清视频| 91在线播放国产| 97精品国产aⅴ7777| 亚洲国产天堂久久国产91| 亚洲精品久久久久久久久久久久| 欧美最猛性xxxxx(亚洲精品)| 日韩风俗一区 二区| 亚洲第一免费播放区| 欧美激情一区二区三级高清视频| 97成人在线视频| 久久久久国产精品免费网站| 日韩黄在线观看| 另类视频在线观看| 国产精品一区二区久久久久| 日韩亚洲欧美中文在线| 美女福利精品视频| 国产网站欧美日韩免费精品在线观看| 亚洲第一天堂无码专区| 日韩大片免费观看视频播放| 成人午夜激情免费视频| 色天天综合狠狠色| 欧美在线观看www| 草民午夜欧美限制a级福利片| 欧美日韩中文在线| 51ⅴ精品国产91久久久久久| 色小说视频一区| 欧美日韩不卡合集视频| 九九精品在线观看| 欧美乱人伦中文字幕在线| 欧美精品福利视频| 久久精品国产99国产精品澳门| 亚洲国产99精品国自产| 在线日韩欧美视频| 国产精品久久久久久久天堂| 日韩精品在线视频| 8x拔播拔播x8国产精品| 午夜精品www| 91tv亚洲精品香蕉国产一区7ujn| 欧美精品在线观看91| 日本一区二区在线免费播放| 亚洲欧美日韩精品久久| 亚洲国产精品成人一区二区| 98午夜经典影视| 国产精品成人免费电影| 久久久黄色av| 狠狠色狠狠色综合日日五| 精品亚洲夜色av98在线观看| 国产精品入口尤物| 日本午夜精品理论片a级appf发布| 亚洲的天堂在线中文字幕| 一区二区中文字幕| 欧美精品video| 精品久久久久久国产91| 国产精品视频免费观看www| 日韩av在线影院| 日韩精品视频三区| 日韩久久午夜影院| 国产日韩精品在线观看| 亚洲成色777777在线观看影院| 亚洲在线免费视频| 日韩成人激情在线| 96sao精品视频在线观看| 亚洲三级 欧美三级| 96精品视频在线| 欧美大片大片在线播放| 日韩网站免费观看| 青青久久av北条麻妃黑人| 欧美国产中文字幕| 4438全国亚洲精品在线观看视频| 亚洲tv在线观看| 97精品久久久中文字幕免费| 日韩中文字幕视频在线观看| 91九色综合久久| 国产日本欧美视频| 欧美激情日韩图片| 国产美女精品视频| 亚洲成年网站在线观看| 91在线观看免费高清| 亚洲色图校园春色| 国产欧美日韩视频| 26uuu国产精品视频| 日韩亚洲欧美中文高清在线| 国产久一一精品| 欧美一区第一页| 一本一道久久a久久精品逆3p| 欧美成人黄色小视频| 国产欧美一区二区三区视频| 国产精品一区二区三区成人| 亚洲女人天堂色在线7777| 国产视频一区在线| 亚洲二区中文字幕| 国产精品丝袜白浆摸在线| 91av在线视频观看| 美女视频黄免费的亚洲男人天堂| 日韩视频在线免费观看| 97色在线视频观看| 国产日韩在线精品av| 91视频8mav| 日韩欧美在线观看视频| 亚洲色图日韩av| 最近2019年中文视频免费在线观看| 久久精品99久久香蕉国产色戒| 国产精品久久久久久搜索| 欧美性受xxx| 国产精品最新在线观看| 国产精品人成电影在线观看| 亚洲护士老师的毛茸茸最新章节| 午夜精品久久久久久99热软件| 欧美激情视频一区二区三区不卡| 欧美在线激情网| 97视频在线观看亚洲| 欧美日韩在线观看视频| 色噜噜狠狠狠综合曰曰曰88av| 国产精品一区二区三区毛片淫片| www.欧美免费| 久久久人成影片一区二区三区观看| 久久久精品2019中文字幕神马| 欧美亚洲国产日本| 欧美精品久久久久久久久| 国产成+人+综合+亚洲欧美丁香花| 日韩精品视频观看| 久久精品夜夜夜夜夜久久| 亚洲电影中文字幕| 久久天天躁狠狠躁夜夜躁| 亚洲午夜av久久乱码| 亚洲综合精品一区二区| 国产精品嫩草影院久久久| 亚洲国产精彩中文乱码av在线播放| 91中文精品字幕在线视频| 欧美日韩一区二区免费在线观看| 中文国产亚洲喷潮| 精品国产一区二区三区四区在线观看| 韩国美女主播一区| 国产精品999| 亚洲精选一区二区|