Sorry, that was maybe not a well educated tip. There are first few fonts used on first page:
/Ft7 18.000 Tf 100.000 Tz /Ft9 12.000 Tf 100.000 Tz /Ft11 12.000 Tf 100.000 Tz And on second page: /Ft7 12.000 Tf 18.000 Tz /Ft9 12.000 Tf 12.000 Tz /Ft11 12.000 Tf 12.000 Tz Where number before Tf is font size and number before Tz is horizontal scaling. It looks like when podofo example is trying to set font size then it is actually setting horizontal scaling like when using SetFontScale instead of SetFontSize (100 is default for horizontal scaling and 12 is default font size in podofo). This could probably happen when is podofo library compiled somehow differently with different options (maybe even with different C++ std library) than that podofo example. Get/SetFontScale and Get/SetFontSize are inline functions so if memory layout of class PdfFontMetrics is different in your exe than in podofo dll then this and other bad things can happen. *protected*: std::string m_sFilename; *float* m_fFontSize; *float* m_fFontScale; For example you can check offset of these members in exe and in dll (or perhaps check size of std::string) and figure out what in your project settings make them different (if they are). On Thu, May 27, 2021 at 4:00 PM Blayne Cullen <blay...@pulsonix.com> wrote: > I’ve had a look at the file (attached) and it’s the same as the one that > was generated with PoDoFo. I’ve also tried uncommenting and defining > PODOFO_HAVE_STRINGS_H, > PODOFO_HAVE_ARPA_INET_H and PODOFO_HAVE_MEM_H and pointing them to their > correct files, but no luck. > > > > *From:* Michal Sudolsky <sudols...@gmail.com> > *Sent:* 25 May 2021 18:15 > *To:* Blayne Cullen <blay...@pulsonix.com> > *Cc:* podofo-us...@lists.sf.net > *Subject:* Re: [Podofo-users] Font size written differs from font size > set. > > > > Maybe something is wrong with your "podofo_config.h"? > > > > On Tue, May 25, 2021 at 3:55 PM Blayne Cullen <blay...@pulsonix.com> > wrote: > > Hello PoDoFo Team, > > > > I have come across something interesting whilst attempting to use PoDoFo. > When writing text to a pdf document using the tools/examples within the > supplied podofo.sln work as they should. However, when writing text outside > of the podofo.sln the text sizes appear wrong. I have even created an exact > duplicate of the helloworld-base14 Project in an external solution but it > still writes incorrect text sizes. Browsing the web I have come across > other’s reporting similar problems but having found no solution, only > temperamental work-arounds such as tweaking the Transformation Matrix until > the correct result are achieved. Attached is a Pdf document that contains > two outputs of the “helloword-base14” project; the first created from > within the supplied podofo.sln and the second in a duplicate external > solution. I have debugged into it a bit and saw that the first error it > makes is in PdfPainter::DrawText(Ln 810) where > m_pFont->GetIdentifier().GetName() is being used, it picks up a different > name in the external solution to the internal solution. The errors continue > down the line within this function as well. > > > > In addition to the Transformation Matrix work-around, it was also > mentioned that the generated PoDoFo library was the cause of the problem. > I’ve rebuilt the library many times using different building tools such as > NMake and Visual Studio, using different versions of PoDoFo source files > (0.9.7 and R2033) and with different versions of PoDoFo’s required > libraries: FreeType, ZLib and Jpeg; all producing the same issue. > > > > My current/target environment are as follows: > > - Visual Studio 2017 > - Freetype 2.10.4, Zlib 1.2.3 (preferably using 1.2.11), Jpeg-9d > - Windows 10 (19041.985) 64bit > - Target PoDoFo libraries: 32bit and 64bit using a shared library (dll) > > > > Some other things I have noticed (which may all lead to the same core > issue) is that other functions that are used in other examples such as > defining the document’s information (e.g. > document.GetInfo()->SetCreator(…)) is throwing a NULLPTR error. Again this > all works within the PoDoFo solution but not in any external solutions. > > > > I hope I have explained the situation well, but if you require any further > details, please don’t hesitate to reply. > > > > Thanks, > > Blayne > > _______________________________________________ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users > >
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users