1、.h头文件
2、生成java代码的conf
PdfiumDocumentConfigure.java
package org.swdc.pdfium.conf;import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.InfoMap;
import org.bytedeco.javacpp.tools.InfoMapper;@Properties(value = {@Platform(value = "windows-x86_64",include = "fpdf_doc.h",link = "pdfium"),@Platform(value = "macosx-x86_64",include = "fpdf_doc.h",link = "pdfium")
},inherit = PdfiumViewConfigure.class,target = "org.swdc.pdfium.core.PdfiumDocument",global = "org.swdc.pdfium.core.PdfiumDocument"
)
public class PdfiumDocumentConfigure implements InfoMapper {@Overridepublic void map(InfoMap infoMap) {}
}
PdfiumEditConfigure.java
package org.swdc.pdfium.conf;import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.Info;
import org.bytedeco.javacpp.tools.InfoMap;
import org.bytedeco.javacpp.tools.InfoMapper;@Properties(value = {@Platform(value = "windows-x86_64",include = {"fpdf_edit.h","fpdf_save.h","ext_fpdf_save.h","ext_fpdf_edit.h"},link = "pdfium"),@Platform(value = "macosx-x86_64",include = {"fpdf_edit.h","fpdf_save.h","ext_fpdf_save.h","ext_fpdf_edit.h"},link = "pdfium")
},inherit = PdfiumViewConfigure.class,target = "org.swdc.pdfium.core.edit",global = "org.swdc.pdfium.core.PdfiumEdit"
)
public class PdfiumEditConfigure implements InfoMapper {@Overridepublic void map(InfoMap infoMap) {infoMap.put(new Info("FPDF_FILEWRITE_").cppTypes("FPDF_FILEWRITE").translate());// do not add ext private methods.infoMap.put(new Info("priv_fpdf_write_data","priv_fpdf_readJpegBytes","FWriter_","PDFWriter").skip());}
}
PdfiumTextConfigure.java
package org.swdc.pdfium.conf;import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.InfoMap;
import org.bytedeco.javacpp.tools.InfoMapper;@Properties(value = {@Platform(value = "windows-x86_64",include = "fpdf_text.h",link = "pdfium"),@Platform(value = "macosx-x86_64",include = "fpdf_text.h",link = "pdfium")
},inherit = PdfiumViewConfigure.class,target = "org.swdc.pdfium.core.PdfiumText",global = "org.swdc.pdfium.core.PdfiumText"
)
public class PdfiumTextConfigure implements InfoMapper {@Overridepublic void map(InfoMap infoMap) {}
}
PdfiumViewConfigure.java
package org.swdc.pdfium.conf;import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.Info;
import org.bytedeco.javacpp.tools.InfoMap;
import org.bytedeco.javacpp.tools.InfoMapper;@Properties(value = {@Platform(value = "windows-x86_64",include = "fpdfview.h",link = "pdfium",preload = "pdfium"),@Platform(value = "macosx-x86_64",include = "fpdfview.h",link = "pdfium",preload = "pdfium")
},target = "org.swdc.pdfium.core.view",global = "org.swdc.pdfium.core.PdfiumView"
)
public class PdfiumViewConfigure implements InfoMapper {@Overridepublic void map(InfoMap infoMap) {translateType(infoMap,"fpdf_annotation_t__","FPDF_ANNOTATION");translateType(infoMap,"fpdf_attachment_t__","FPDF_ATTACHMENT");translateType(infoMap,"fpdf_avail_t__","FPDF_AVAIL");translateType(infoMap,"fpdf_bitmap_t__","FPDF_BITMAP");translateType(infoMap,"fpdf_bookmark_t__","FPDF_BOOKMARK&#