Comments (6)
Sorry not mentioning it immediately. Thanks for update, I will pull it.
from pdfiumandroid.
Creating bitmap doesn't flatten pdf document. There is method for flattening in Pdfium, but it's not exposed in Java.
from pdfiumandroid.
I thought renderPageBitmap
performed flattening + conversion to Bitmap all togheter.
What is the corresponding C++ method in the library to do this? (i don't know too much about C++ but if it's not too hard i can try to create a PR with a wrapper function for this feature)
PS: i've found it, should be this if i'm not wrong
from pdfiumandroid.
I've performed some researches and work, i've created a new method and in the last part of it (following the renderPageBitmap code) I've added the central lines.
....
FPDFBitmap_FillRect( pdfBitmap, baseX, baseY, baseHorSize, baseVerSize,
0xFFFFFFFF); //White
//flat the page before proceeding with Bitmap creation
const int result = FPDFPage_Flatten(page, flatType);
if (result == FLATTEN_FAIL){
jniThrowException(env, "com/shockwave/pdfium/PdfiumCore", "PDF flattening has failed.");
}
FPDF_RenderPageBitmap( pdfBitmap, page,
startX, startY,
(int)drawSizeHor, (int)drawSizeVer,
0, flags );
.....
i've tried with 2 different sample PDF with form fields filled, but a the end i only get a PDF without them.
Maybe i need to save and reopen the document?
Any suggestions?
from pdfiumandroid.
Sorry, I forgot to mention that you should try using last parameter of .renderPage()
method, which is boolean renderAnnot
. It should render annotations and forms.
from pdfiumandroid.
Lol, now it's working fine passing true to the renderAnnot
param.
I've wasted an evening working on something which was already working XD (at least i've learned something new 😋)
Btw thank you man, i've created a PR to update the example code to avoid future issues on the same thing
from pdfiumandroid.
Related Issues (20)
- The missing so library name is jniPdfium HOT 1
- Need update for androidx HOT 1
- is there a way to get thumb bitmap, renderPageBitmap with getPageWidth as input cost too much time HOT 1
- Permission Denial: opening provider
- How to check if a pdf file is password protected HOT 6
- Failing to open in-memory files
- How to perform content search on PDF File? HOT 1
- Not an issue, just a question regarding bindings
- How to add library to project like module import gradle project HOT 3
- generate page pdf to bitmap not found digital signature on page, Please help me HOT 2
- Do you support 64 bits?
- FPDF_RenderPageBitmap out of memory
- Memory leak when opening PDF as a byte array HOT 5
- Text fonts not showing while creating PDF from few custom OS 12 (Samsung)
- What is the difference between default ones and this. Can you update this ?
- I wrote an version in Kotlin
- Memory Leack
- Is it possible to get input stream of a password protected PDF?
- PdfiumAndroid with Supporting Android API >=21 HOT 1
- failled to resolve HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfiumandroid.