Hi,
i identified the problem.
When using GlobalPdfDocEncodingInstance() it works correctly, but NOT with
GlobalIdentityEncodingInstance()! I Used this because the docs say: "useful for
writing direct UTF8 strings“!
//EXAMPLE
PoDoFo::PdfMemDocument writer;
PoDoFo::PdfPage* pPage =
writer.CreatePage(PoDoFo::PdfPage::CreateStandardPageSize(PoDoFo::ePdfPageSize_A4));
PoDoFo::PdfPainter ppainter;
const PoDoFo::PdfEncoding* encFac;
encFac = PoDoFo::PdfEncodingFactory::GlobalIdentityEncodingInstance();
ppainter.SetPage(pPage);
PoDoFo::PdfFont* pFont = NULL;
try {
pFont = writer.CreateFont("HaboroContrast-NorReg", false, false, false, encFac,
PoDoFo::PdfFontCache::eFontCreationFlags_AutoSelectBase14, true);
}
catch (PoDoFo::PdfError& e) {
pFont = writer.CreateFont("Arial",
PoDoFo::PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), false);
}
if (!pFont)
{
PODOFO_RAISE_ERROR(PoDoFo::ePdfError_InvalidHandle);
}
pFont->SetFontSize(16.0);
ppainter.SetFont(pFont);
ppainter.DrawText(100, 100, "ABC");
ppainter.FinishPage();
writer.Write("C:\\Users\\christian\\Desktop\\podofo.pdf“);
I am using v0.9.6
--
Grüße/Regards,
[heubach-media] | Christian Sakowski
[email protected]
Tel: +49/(0)40/52 10 59-23
> Am 04.12.2025 um 10:29 schrieb Francesco Pretto <[email protected]>:
>
> Hello,
>
> please: attach a self compilable code which shows the problem and report the
> PoDoFo version.
>
> Francesco
>
> On Thu, 4 Dec 2025 at 09:38, Christian Sakowski
> <[email protected]> wrote:
> Hi,
>
> i have created a simple output with the letter „A“ and the font
> "haboro-contrast-normal-medium.otf“.
> But in PoDoFo there is a space after the letter „A“, when creating an output
> with MS Print To PDF, there is no such space.
> See attachments.
> Any hint where to find a solution?
> Many thanks!
>
---
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: [email protected]
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach
Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich
erhalten haben, informieren Sie bitte sofort den Absender
und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users