Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - [Android SDK] Issue with text/font not rendered
  FAQ FAQ  Forum Search   Register Register  Login Login

[Android SDK] Issue with text/font not rendered

 Post Reply Post Reply
Author
Message
k.szalach View Drop Down
Beginner
Beginner


Joined: 28 Sep 23
Location: Poland
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote k.szalach Quote  Post ReplyReply Direct Link To This Post Topic: [Android SDK] Issue with text/font not rendered
    Posted: 28 Sep 23 at 8:29AM
Hello!

I know that library is already discontinued from being supported, but maybe someone will be able to help.
I have a PDF file which has a text that uses FreeSans font. There are also some other fonts in this PDF, but only text with FreeSans is not rendered at all when using quick PDF SDK (we use rendertobitmap option). 

I've tried to check if the fonts are embedded into the file and using Adobe Reader it seems that only Helvetica is embedded. I confirmed this also by checking within library using FindFonts and getting the font data:
(0 until pdfLibrary.FindFonts()).forEach { fontIndex ->
val fontId = pdfLibrary.GetFontID(fontIndex)
pdfLibrary.SelectFont(fontId)
Trace.i(TAG, "Font: ${pdfLibrary.FontName()}, ${pdfLibrary.FontFamily()}, ${pdfLibrary.FontSize()}, ${pdfLibrary.FontType()}, ${pdfLibrary.FontHasKerning()}, ${pdfLibrary.FontReference()}")
}

And the outcome is:
Font: , , 0, 0, 0, 
Font: Helvetica, , 0, 2, 0, QuickPDFF03FF2F0B

Although no clue what the first font is, but I guess it doesn't matter. As checked here http://www.quickpdf.org/forum/nonembedded-fonts-not-working_topic3601.html it looks like there are only few embedded fonts in the library. So does it mean that if other fonts are not embedded into PDF file, then the library will not be able to display them?

My questions are:
- is it possible to somehow replace on-the-fly fonts, that are not available with some other standard ones? I've seen a method ReplaceFonts, but I couldn't find any info about it.
- is it possible to add font on-the-fly so the library will be able to render them? All examples I've found are using adding fonts when creating new text or filling form fields, so I don't feel they apply to our use case.

And now, the most strange part is that this issue occurs only on Android 12, 13 and 14, but not on Android 9, 10 or 11. So it looks like something also changed in Android system that makes it not working anymore. I also did profiling on Android 13 and it looks like there is some issue with SelectFont function in library, which makes significant amount of time.

Appreciate any help, thank you!
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3527
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 23 at 2:47PM
Hi Krzysztof ... welcome here :) 

Don't think that nobody is looking here but QuickPDF is mainly used with windows development.
Due to this experts regarding android will be less here.
So please be patient and don't stop trying yourself ;-)

Cheers,
Ingo

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 02 Oct 23 at 10:12PM
If the font is not embedded in the PDF and not on the device, then clearly text in that specific font will not be displayed. I am one of the Windows developers whom Ingo describes as the majority here, so I cannot help you with details of how and whether fonts can be substituted on Android, or how you would find a suitable font to substitute on an Android device; sorry.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3527
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 03 Oct 23 at 10:33PM
Hi Tim :)

But i think that the used pdf-reader tries to display the text in a similar layout if the exact font is missing?
Cheers,
Ingo

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 04 Oct 23 at 10:53AM
But I think the 'used pdf-reader' in this case may be the app which Krzysztof is writing, in which the PDF is to be displayed or rendered. And I have no idea how different versions (or any versions) of Android deal with  fonts, so there is little more I can say.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store