Giter Club home page Giter Club logo

Comments (4)

galkahana avatar galkahana commented on July 20, 2024

I have no idea. seriously.
I'm not sure that you can actually use Tf in such a context.

Specifically i don't see a resources dictionary reference here that you coud hang a font definition on.
If you would, i would tell you to simply follow AbstractContentContext::WriteText and figure out what you need from there (https://github.com/galkahana/PDF-Writer/blob/master/PDFWriter/AbstractContentContext.cpp#L1409)

but what will you do with the font that you get? i see no resources dictionary here.

donnow.

from pdf-writer.

magicboker avatar magicboker commented on July 20, 2024

I use Tf to set the font name and font size for displaying the contents (text) in a FreeText annotation.

In the pdf spec: page 679 in (pdf_reference_1-7.pdf)

The default appearance string (DA) contains any graphics state or text state oper- ators needed to establish the graphics state parameters, such as text size and color, for displaying the field’s variable text. Only operators that are allowed within text objects may occur in this string (see Figure 4.1 on page 197). At a minimum, the string must include a Tf (text font) operator along with its two operands, font and size. The specified font value must match a resource name in the Font entry of the default resource dictionary (referenced from the DR entry of the interactive form dictionary; see Table 8.67). A zero value for size means that the font is to be auto- sized: its size is computed as a function of the height of the annotation rectangle.

Please see the screenshot of the example pdf generated by Adobe Acrobat Pro: I highlighted the DA entry in a FreeText annotation and the associated font entries in the Font dictionaries.
example

from pdf-writer.

galkahana avatar galkahana commented on July 20, 2024

well, that's true for form. but what about text free annotation?

from pdf-writer.

magicboker avatar magicboker commented on July 20, 2024

DA is a required field in FreeText annotation to set font name, size, and text color.
In the pdf spec: page 624 in (pdf_reference_1-7.pdf)
example

from pdf-writer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.