-
Notifications
You must be signed in to change notification settings - Fork 25
Implementation new libpdfium so libs #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,38 @@ FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDFPage_New(FPDF_DOCUMENT document, | |
| FPDF_EXPORT void FPDF_CALLCONV FPDFPage_Delete(FPDF_DOCUMENT document, | ||
| int page_index); | ||
|
|
||
| // Experimental API. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these just due to the new version of pdfium?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
| // Move the given pages to a new index position. | ||
| // | ||
| // page_indices - the ordered list of pages to move. No duplicates allowed. | ||
| // page_indices_len - the number of elements in |page_indices| | ||
| // dest_page_index - the new index position to which the pages in | ||
| // |page_indices| are moved. | ||
| // | ||
| // Returns TRUE on success. If it returns FALSE, the document may be left in an | ||
| // indeterminate state. | ||
| // | ||
| // Example: The PDF document starts out with pages [A, B, C, D], with indices | ||
| // [0, 1, 2, 3]. | ||
| // | ||
| // > Move(doc, [3, 2], 2, 1); // returns true | ||
| // > // The document has pages [A, D, C, B]. | ||
| // > | ||
| // > Move(doc, [0, 4, 3], 3, 1); // returns false | ||
| // > // Returned false because index 4 is out of range. | ||
| // > | ||
| // > Move(doc, [0, 3, 1], 3, 2); // returns false | ||
| // > // Returned false because index 2 is out of range for 3 page indices. | ||
| // > | ||
| // > Move(doc, [2, 2], 2, 0); // returns false | ||
| // > // Returned false because [2, 2] contains duplicates. | ||
| // | ||
| FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV | ||
| FPDF_MovePages(FPDF_DOCUMENT document, | ||
| const int* page_indices, | ||
| unsigned long page_indices_len, | ||
| int dest_page_index); | ||
|
|
||
| // Get the rotation of |page|. | ||
| // | ||
| // page - handle to a page | ||
|
|
@@ -731,6 +763,19 @@ FPDFImageObj_GetImageMetadata(FPDF_PAGEOBJECT image_object, | |
| FPDF_PAGE page, | ||
| FPDF_IMAGEOBJ_METADATA* metadata); | ||
|
|
||
| // Experimental API. | ||
| // Get the image size in pixels. Faster method to get only image size. | ||
| // | ||
| // image_object - handle to an image object. | ||
| // width - receives the image width in pixels; must not be NULL. | ||
| // height - receives the image height in pixels; must not be NULL. | ||
| // | ||
| // Returns true if successful. | ||
| FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV | ||
| FPDFImageObj_GetImagePixelSize(FPDF_PAGEOBJECT image_object, | ||
| unsigned int* width, | ||
| unsigned int* height); | ||
|
|
||
| // Create a new path object at an initial position. | ||
| // | ||
| // x - initial horizontal position. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,8 +284,8 @@ Java_io_legere_pdfiumandroid_PdfiumCore_nativeOpenMemDocument(JNIEnv *env, jobje | |
| } | ||
|
|
||
| int size = (int) env->GetArrayLength(data); | ||
| auto *cDataCopy = new jbyte[size]; | ||
| env->GetByteArrayRegion(data, 0, size, cDataCopy); | ||
| auto *cDataCopy = malloc(size); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this being changed to malloc? |
||
| env->GetByteArrayRegion(data, 0, size, static_cast<jbyte *>(cDataCopy)); | ||
| FPDF_DOCUMENT document = FPDF_LoadMemDocument( reinterpret_cast<const void*>(cDataCopy), | ||
| size, cpassword); | ||
|
|
||
|
|
@@ -312,7 +312,7 @@ Java_io_legere_pdfiumandroid_PdfiumCore_nativeOpenMemDocument(JNIEnv *env, jobje | |
| } | ||
|
|
||
| docFile->pdfDocument = document; | ||
| docFile->cDataCopy = cDataCopy; | ||
| docFile->cDataCopy = static_cast<jbyte *>(cDataCopy); | ||
| return reinterpret_cast<jlong>(docFile); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you changing these dependencies? Its not necessarily a dead-breaker, but it needs to be clearly justified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because, libpdfium.so, already contains all required dependencies