PoDoFo doesn’t support subsetting a font (that’s the term for partial
embedding). Please feel free to contribute.
Leonard
From: "F. E." <exler7...@gmail.com>
Date: Monday, June 19, 2017 at 11:25 AM
To: "podofo-users@lists.sourceforge.net" <podofo-users@lists.sourceforge.net>
Subject: Re: [Podofo-users] DrawText & Unicode
First of all, thanks for the swift response :).
I applied the identity encoding, which does not resolve my issue, but it still
improved the output ("unknown character" symbols are now written, before there
was nothing).
The font seems not to be installed on my system (which is strange, since I read
that it is included in MS Office, which I have installed). I checked my
installed fonts and found and tried "Lucida Sans Unicode", but to no avail. I
downloaded fonts for all languages and took one with assumed support for my
unicode characters, that one worked.
Unfortunately, this fonts take up much space and get embedded into the result
pdf, increasing the size by up to 10MB. Thats quite a large payload for just a
few characters of a disclaimer text :-/.Is there any way to improve this
behaviour (somehow "partially" embed a font)?
Greetings
F.E.
2017-06-19 10:31 GMT+02:00 Jaseem Ali K T
<jaseemal...@hcl.com<mailto:jaseemal...@hcl.com>>:
Hi
Which OS are you using?(assuming the latest podfo is being used)
Do you have "Arial MS Unicode" installed in your system?
If “Arial MS Unicode” is not installed please use some other font, which
supports all Unicode characters. Also please set the encoding to identity
encoding.
Regards
Ali
From: F. E. [mailto:exler7...@gmail.com<mailto:exler7...@gmail.com>]
Sent: 18 June 2017 23:03
To:
podofo-users@lists.sourceforge.net<mailto:podofo-users@lists.sourceforge.net>
Subject: [Podofo-users] DrawText & Unicode
Hello Podofo Users,
I'm want to add a small text disclaimer to the first page of a document:
// Set page disclaimer
PdfPainter pdfPainter;
PdfFont* pFont = m_pDocument->CreateFont("Arial");
PdfPage* pPage = m_pDocument->GetPage(0);
pdfPainter.SetPage( pPage );
pdfPainter.Save();
pdfPainter.SetFont( pFont );
pdfPainter.GetFont()->SetFontSize( PAGE_DISLAIMER_SIZE );
pdfPainter.SetColor( 0.0, 0.0, 0.0 ); // black
PdfRect rect = pPage->GetMediaBox();
PoDoFo::PdfString disclaimer_inutf8(reinterpret_cast<const
PoDoFo::pdf_utf8*>(disclaimer.c_str()));
pdfPainter.DrawText( rect.GetLeft(), rect.GetBottom() + rect.GetHeight() -
PAGE_DISLAIMER_SIZE, disclaimer_inutf8 );
pdfPainter.Restore();
pdfPainter.FinishPage();
The code works for normal text, but it fails to draw unicode characters.
I consulted the corresponding test code and saw that there's a unicode font
used:
PdfFont* pFont = m_pDocument->CreateFont("Arial MS Unicode");
Unfortunately, I get a NULL pointer from this call. Is there anything I can do
except downloading a font,
because this is not an option, the code should work without installing
additional things.
Thanks in advance
F.E.
::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction,
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and
other defects.
----------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsdm.link%2Fslashdot&data=02%7C01%7C%7C1bcaa6f388ad436d8a7908d4b727b56b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636334828584790059&sdata=Gjg0t3N54sqJ%2BI9wnFmdb5c%2FaTncTR24OHfWDqo9rn0%3D&reserved=0>
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net<mailto:Podofo-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/podofo-users<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpodofo-users&data=02%7C01%7C%7C1bcaa6f388ad436d8a7908d4b727b56b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636334828584790059&sdata=Wa1Wwb7rzanfs36pj8n6%2FnPgaIalGziqytgD42lKNY0%3D&reserved=0>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users