Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

Black text are not rendering as pure black 7 years 2 weeks ago #12222

  • Kin Chung
  • Kin Chung's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 0
I tried to use RenderToBmp(bmp, mat) to render a PDF page to a bitmap.
However, I found that the black text becomes (33, 32, 32) instead of (0, 0, 0)
Are there any settings to make it becomes (0,0,0)?

Please Log in or Create an account to join the conversation.

Black text are not rendering as pure black 7 years 2 weeks ago #12228

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
We need more information:
Which Radaee SDK version are you using?
On what resolution are you generating the image?
Can you please send us the pdf, and the code you are using?

Please Log in or Create an account to join the conversation.

Black text are not rendering as pure black 7 years 2 weeks ago #12234

  • Kin Chung
  • Kin Chung's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 0
Here is the PDF file.

And my code is as follow:
int dpi = 300;

float w = doc.GetPageWidth(pageNo) * dpi / 72;
float h = doc.GetPageHeight(pageNo) * dpi / 72;
final Page pdfPage = doc.GetPage(pageNo);
Bitmap bmp = Bitmap.createBitmap((int) w, (int) h, Bitmap.Config.ARGB_8888);
bmp.eraseColor(Color.WHITE);
Matrix mat = new Matrix(dpi/72f, -dpi/72f, 0, h);
pdfPage.RenderToBmp(bmp, mat);
Attachments:

Please Log in or Create an account to join the conversation.

Black text are not rendering as pure black 7 years 2 weeks ago #12240

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
We have tried your pdf, with the latest version 3.12RC and the bitmap is generated correctly

Document document = new Document();
PDFAssetStream m_asset_stream = new PDFAssetStream();
m_asset_stream.open(getAssets(), "eNAR1.pdf");
document.OpenStream(m_asset_stream, "");
Global.mBitmap = Bitmap.createBitmap((int) (document.GetPageWidth(0)), (int)
		(document.GetPageHeight(0)), Bitmap.Config.ARGB_8888);
Page page = document.GetPage(0);
Global.mBitmap.eraseColor(Color.WHITE);
page.RenderToBmp(Global.mBitmap, new Matrix( 1, -1, 0, document.GetPageHeight(0)));
page.Close();
document.Close();
Can you please recheck with the latest version?
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by nermeen.

Black text are not rendering as pure black 7 years 1 week ago #12268

  • Kin Chung
  • Kin Chung's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 0
I tested 3.12 RC12 with RDPDFReader Sample app
However, it is still rendering grey instead of black

Here is the screenshot of the file opened attached.

My Device : Samsung Galaxy Tab S2 (SM-T813), Android 6.0.1
Attachments:

Please Log in or Create an account to join the conversation.

Black text are not rendering as pure black 7 years 1 week ago #12269

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Are you using the code below? using this code we cannot reproduce the grey text, as you can see in the screenshot
We have tested on Samsung Galaxy Tab S (6.0.1)
Global.mBitmap = Bitmap.createBitmap((int) (document.GetPageWidth(0)), (int)
		(document.GetPageHeight(0)), Bitmap.Config.ARGB_8888);
Page page = document.GetPage(0);
Global.mBitmap.eraseColor(Color.WHITE);
page.RenderToBmp(Global.mBitmap, new Matrix( 1, -1, 0, document.GetPageHeight(0)));
page.Close();
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by nermeen.
  • Page:
  • 1
  • 2
Powered by Kunena Forum