// Path: app/src/main/java-gen/sxkeji/net/dailydiary/Article.java
// public class Article implements Serializable{
// 
//     private Long id;
//     /** Not-null value. */
//     private String date;
//     private String address;
//     private String weather;
//     /** Not-null value. */
//     private String title;
//     /** Not-null value. */
//     private String content;
//     private Integer type;
//     private String img_path;
//     private String objectId;
// 
//     // KEEP FIELDS - put your custom fields here
//     // KEEP FIELDS END
// 
//     public Article() {
//     }
// 
//     public Article(Long id) {
//         this.id = id;
//     }
// 
//     public Article(Long id, String date, String address, String weather, String title, String content, Integer type, String img_path, String objectId) {
//         this.id = id;
//         this.date = date;
//         this.address = address;
//         this.weather = weather;
//         this.title = title;
//         this.content = content;
//         this.type = type;
//         this.img_path = img_path;
//         this.objectId = objectId;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     /** Not-null value. */
//     public String getDate() {
//         return date;
//     }
// 
//     /** Not-null value; ensure this value is available before it is saved to the database. */
//     public void setDate(String date) {
//         this.date = date;
//     }
// 
//     public String getAddress() {
//         return address;
//     }
// 
//     public void setAddress(String address) {
//         this.address = address;
//     }
// 
//     public String getWeather() {
//         return weather;
//     }
// 
//     public void setWeather(String weather) {
//         this.weather = weather;
//     }
// 
//     /** Not-null value. */
//     public String getTitle() {
//         return title;
//     }
// 
//     /** Not-null value; ensure this value is available before it is saved to the database. */
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     /** Not-null value. */
//     public String getContent() {
//         return content;
//     }
// 
//     /** Not-null value; ensure this value is available before it is saved to the database. */
//     public void setContent(String content) {
//         this.content = content;
//     }
// 
//     public Integer getType() {
//         return type;
//     }
// 
//     public void setType(Integer type) {
//         this.type = type;
//     }
// 
//     public String getImg_path() {
//         return img_path;
//     }
// 
//     public void setImg_path(String img_path) {
//         this.img_path = img_path;
//     }
// 
//     public String getObjectId() {
//         return objectId;
//     }
// 
//     public void setObjectId(String objectId) {
//         this.objectId = objectId;
//     }
// 
//     // KEEP METHODS - put your custom methods here
//     // KEEP METHODS END
// 
// }


import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.independentsoft.office.ExtendedBoolean;
import com.independentsoft.office.Unit;
import com.independentsoft.office.UnitType;
import com.independentsoft.office.drawing.Extents;
import com.independentsoft.office.drawing.Offset;
import com.independentsoft.office.drawing.Picture;
import com.independentsoft.office.drawing.PresetGeometry;
import com.independentsoft.office.drawing.ShapeType;
import com.independentsoft.office.drawing.Transform2D;
import com.independentsoft.office.word.DrawingObject;
import com.independentsoft.office.word.Paragraph;
import com.independentsoft.office.word.Run;
import com.independentsoft.office.word.WordDocument;
import com.independentsoft.office.word.drawing.DrawingObjectSize;
import com.independentsoft.office.word.drawing.Inline;
import java.io.IOException;
import java.util.ArrayList;
import sxkeji.net.dailydiary.Article;
package sxkeji.net.dailydiary.utils;





/**
 * word文档生成
 * Created by zhangshixin on 5/6/2016.
 */
public class JWordUtils {
    private static final String TAG = "JWordUtils";
    private Context mContext;
    private StringBuilder mSaveName;   //保存文件的名称，以时间保存
    private String mSavePath;   //保存文件地址
    private String mSaveType;   //保存文件类型
    private int mPictureWidth = 640;
    private int mPictureHeight = 480;

    public JWordUtils(Context mContext) {
        this.mContext = mContext;
        mSavePath = FileUtils.getExportDir(mContext);
        mSaveType = ".docx";
    }

    /**
     * 将article导出为文件
     *
     * @param articles
     */
    public void createArticle2Word(ArrayList<Article> articles) {
        if (articles != null) {
            for (Article article : articles) {
                createArticle2Word(article);
            }
        }
    }

    /**
     * 将article导出为文件
     *
     * @param article
     */
// Path: app/src/main/java-gen/sxkeji/net/dailydiary/Article.java
// public class Article implements Serializable{
// 
//     private Long id;
//     /** Not-null value. */
//     private String date;
//     private String address;
//     private String weather;
//     /** Not-null value. */
//     private String title;
//     /** Not-null value. */
//     private String content;
//     private Integer type;
//     private String img_path;
//     private String objectId;
// 
//     // KEEP FIELDS - put your custom fields here
//     // KEEP FIELDS END
// 
//     public Article() {
//     }
// 
//     public Article(Long id) {
//         this.id = id;
//     }
// 
//     public Article(Long id, String date, String address, String weather, String title, String content, Integer type, String img_path, String objectId) {
//         this.id = id;
//         this.date = date;
//         this.address = address;
//         this.weather = weather;
//         this.title = title;
//         this.content = content;
//         this.type = type;
//         this.img_path = img_path;
//         this.objectId = objectId;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     /** Not-null value. */
//     public String getDate() {
//         return date;
//     }
// 
//     /** Not-null value; ensure this value is available before it is saved to the database. */
//     public void setDate(String date) {
//         this.date = date;
//     }
// 
//     public String getAddress() {
//         return address;
//     }
// 
//     public void setAddress(String address) {
//         this.address = address;
//     }
// 
//     public String getWeather() {
//         return weather;
//     }
// 
//     public void setWeather(String weather) {
//         this.weather = weather;
//     }
// 
//     /** Not-null value. */
//     public String getTitle() {
//         return title;
//     }
// 
//     /** Not-null value; ensure this value is available before it is saved to the database. */
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     /** Not-null value. */
//     public String getContent() {
//         return content;
//     }
// 
//     /** Not-null value; ensure this value is available before it is saved to the database. */
//     public void setContent(String content) {
//         this.content = content;
//     }
// 
//     public Integer getType() {
//         return type;
//     }
// 
//     public void setType(Integer type) {
//         this.type = type;
//     }
// 
//     public String getImg_path() {
//         return img_path;
//     }
// 
//     public void setImg_path(String img_path) {
//         this.img_path = img_path;
//     }
// 
//     public String getObjectId() {
//         return objectId;
//     }
// 
//     public void setObjectId(String objectId) {
//         this.objectId = objectId;
//     }
// 
//     // KEEP METHODS - put your custom methods here
//     // KEEP METHODS END
// 
// }


// Path: app/src/main/java/sxkeji/net/dailydiary/utils/JWordUtils.java
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.independentsoft.office.ExtendedBoolean;
import com.independentsoft.office.Unit;
import com.independentsoft.office.UnitType;
import com.independentsoft.office.drawing.Extents;
import com.independentsoft.office.drawing.Offset;
import com.independentsoft.office.drawing.Picture;
import com.independentsoft.office.drawing.PresetGeometry;
import com.independentsoft.office.drawing.ShapeType;
import com.independentsoft.office.drawing.Transform2D;
import com.independentsoft.office.word.DrawingObject;
import com.independentsoft.office.word.Paragraph;
import com.independentsoft.office.word.Run;
import com.independentsoft.office.word.WordDocument;
import com.independentsoft.office.word.drawing.DrawingObjectSize;
import com.independentsoft.office.word.drawing.Inline;
import java.io.IOException;
import java.util.ArrayList;
import sxkeji.net.dailydiary.Article;

package sxkeji.net.dailydiary.utils;





/**
 * word文档生成
 * Created by zhangshixin on 5/6/2016.
 */
public class JWordUtils {
    private static final String TAG = "JWordUtils";
    private Context mContext;
    private StringBuilder mSaveName;   //保存文件的名称，以时间保存
    private String mSavePath;   //保存文件地址
    private String mSaveType;   //保存文件类型
    private int mPictureWidth = 640;
    private int mPictureHeight = 480;

    public JWordUtils(Context mContext) {
        this.mContext = mContext;
        mSavePath = FileUtils.getExportDir(mContext);
        mSaveType = ".docx";
    }

    /**
     * 将article导出为文件
     *
     * @param articles
     */
    public void createArticle2Word(ArrayList<Article> articles) {
        if (articles != null) {
            for (Article article : articles) {
                createArticle2Word(article);
            }
        }
    }

    /**
     * 将article导出为文件
     *
     * @param article
     */
    public void createArticle2Word(Article article) {