Trending

#PDFwithPython

Latest posts tagged with #PDFwithPython on Bluesky

Latest Top
Trending

Posts tagged #PDFwithPython

Post image

๐Ÿงฉ Day 13 of my #PDFwithPython journey

Today I learned how to find and inspect text fragments in a PDF โ€” the first step toward text replacement!
๐Ÿ’ก What I learned:
- TextFragmentAbsorber searches text by phrase or area
- Each fragment gives position and style info
#Python #LearnPython #100DaysOfCode

4 0 0 0
Post image

๐Ÿงฉ Day 12 of my #PDFwithPython journey

Today I experimented with text rotation in Aspose.PDF โ€” rotating text fragments at different angles to create dynamic layouts.
๐ŸŽจ Output: text rotated at multiple angles!
Perfect for creative layouts and titles.

#Python #PDF #LearnPython #100DaysOfCode

4 0 0 0
Post image

๐Ÿงฉ Day 11 of my #PDFwithPython journey
Today I tried creating an ordered list using LaTeX inside a PDF!
Aspose.PDF can render LaTeX environments like enumerate directly โ€” no HTML required โœจ
๐Ÿ“„ Output: a perfectly formatted numbered list โ€” rendered from LaTeX syntax!
#Python #PDF #100DaysOfCode

5 0 0 0
Post image

๐Ÿงฉ Day 10 of my #PDFwithPython journey

Today I learned how to create bulleted lists in a PDF using HTML โ€” super quick and clean.

โœ… Aspose.PDF renders <ul><li></li></ul> automatically โ€” no manual formatting.

#Python #PDF #100DaysOfCode

3 0 0 0
import aspose.pdf as ap, os

document = ap.Document()
page = document.pages.add()

lorem_path = os.path.join("E:\\Samples\\Text", "lorem.txt")
text = (
    open(lorem_path, "r", encoding="utf-8").read()
    if os.path.exists(lorem_path)
    else "Lorem ipsum text not found."
)

fragment = ap.text.TextFragment(text)
fragment.text_state.font_size = 12
fragment.text_state.line_spacing = 16  # Custom line spacing

page.paragraphs.add(fragment)
document.save("line_spacing.pdf")

import aspose.pdf as ap, os document = ap.Document() page = document.pages.add() lorem_path = os.path.join("E:\\Samples\\Text", "lorem.txt") text = ( open(lorem_path, "r", encoding="utf-8").read() if os.path.exists(lorem_path) else "Lorem ipsum text not found." ) fragment = ap.text.TextFragment(text) fragment.text_state.font_size = 12 fragment.text_state.line_spacing = 16 # Custom line spacing page.paragraphs.add(fragment) document.save("line_spacing.pdf")

๐Ÿงฉ Day 9 of my #PDFwithPython journey

Today I worked with line spacing โ€” a key formatting option when rendering longer text blocks in PDFs. Increasing line spacing improves readability, especially for paragraphs and multi-line content.

#Python #PDF #LearnPython #100DaysOfCode

3 0 0 0
import aspose.pdf as ap
from aspose.pdf.text import TextFragment, FontRepository

doc = ap.Document()
page = doc.pages.add()

for spacing in [2.0, 1.0, 0.75]:
    fragment = TextFragment("Sample Text with character spacing")
    fragment.text_state.font = FontRepository.find_font("Arial")
    fragment.text_state.font_size = 14
    fragment.text_state.character_spacing = spacing
    page.paragraphs.add(fragment)

doc.save("character_spacing.pdf")

import aspose.pdf as ap from aspose.pdf.text import TextFragment, FontRepository doc = ap.Document() page = doc.pages.add() for spacing in [2.0, 1.0, 0.75]: fragment = TextFragment("Sample Text with character spacing") fragment.text_state.font = FontRepository.find_font("Arial") fragment.text_state.font_size = 14 fragment.text_state.character_spacing = spacing page.paragraphs.add(fragment) doc.save("character_spacing.pdf")

๐Ÿงฉ Day 8 of my #PDFwithPython journey
Today I explored character spacing in Aspose.PDF for Python โ€” a simple way to control how tight or loose text appears in a PDF.
๐Ÿ” What I learned: Useful for typography tweaks. A small change can dramatically affect readability

#Python #LearnPython #100DaysOfCode

2 0 0 0
Post image

๐Ÿงฉ Day 7 of my #PDFwithPython journey
Today I experimented with radial gradient shading on text using aspose.pdf.
This feature lets you fill text with a circular gradient โ€” here from ๐Ÿ”ด red to ๐Ÿ”ต blue โ€” creating a vibrant, eye-catching PDF title.

#Python #100DaysOfCode #GradientText

5 0 0 0
import aspose.pdf as ap

document = ap.Document()
page = document.pages.add()

text = ap.text.TextFragment(
        "This is the transparent text. "
        "This is the transparent text. "
        "This is the transparent text."
    )
text.text_state.foreground_color = ap.Color.from_argb(0, 0, 255, 0)
page.paragraphs.add(text)

document.save("transparent_text.pdf")

import aspose.pdf as ap document = ap.Document() page = document.pages.add() text = ap.text.TextFragment( "This is the transparent text. " "This is the transparent text. " "This is the transparent text." ) text.text_state.foreground_color = ap.Color.from_argb(0, 0, 255, 0) page.paragraphs.add(text) document.save("transparent_text.pdf")

๐Ÿงฉ Day 6 of my #PDFwithPython journey

Today I experimented with transparent text โ€” a neat way to make text blend naturally with the page background.
๐ŸŽจ The result: by adjusting the alpha (A) value, you can fine-tune the opacity for watermark effects.
#Python #PDF #LearnPython #100DaysOfCode

5 0 0 0
import aspose.pdf as ap

document = ap.Document()
page = document.pages.add()
latex_content = "$ \\sqrt{x^2+y^2} $"

latex_fragment = ap.TeXFragment(latex_content)

page.paragraphs.add(latex_fragment)
document.save("latex_fragment.pdf")

import aspose.pdf as ap document = ap.Document() page = document.pages.add() latex_content = "$ \\sqrt{x^2+y^2} $" latex_fragment = ap.TeXFragment(latex_content) page.paragraphs.add(latex_fragment) document.save("latex_fragment.pdf")

๐Ÿงฉ Day 5 of my #PDFwithPython journey

Today I learned how to add LaTeX formulas directly into a PDF using aspose.pdf.
Math in PDFs just got easier โ€” no image rendering or manual layout!

Aspose.PDF automatically converts LaTeX syntax into beautiful, scalable math symbols ๐Ÿงฎ

#LaTeX #100DaysOfCode

4 0 0 0
import aspose.pdf as ap

document = ap.Document()
page = document.pages.add()
html_content = "<h1>Header <i>1</i></h1>"
for i in range(5):
    html_content += f"<p>Paragraph <b>{i+1}</b></p>"

html_content += "a<sub>2</sub>+b<sup>3<sup>"
html_fragment = ap.HtmlFragment(html_content)

page.paragraphs.add(html_fragment)
document.save("html_fragment.pdf")

import aspose.pdf as ap document = ap.Document() page = document.pages.add() html_content = "<h1>Header <i>1</i></h1>" for i in range(5): html_content += f"<p>Paragraph <b>{i+1}</b></p>" html_content += "a<sub>2</sub>+b<sup>3<sup>" html_fragment = ap.HtmlFragment(html_content) page.paragraphs.add(html_fragment) document.save("html_fragment.pdf")

๐Ÿงฉ Day 4 of my #PDFwithPython journey

Today I explored how to insert HTML-formatted text directly into a PDF.

Headings, bold or italic text, subscripts, and superscripts โ€” all render beautifully!

No need to manually style paragraphs โ€” HTML does the job!
#Python #PDF #100DaysOfCode

3 0 0 0
import aspose.pdf as ap

doc = ap.Document()
page = doc.pages.add()

text = "Lorem ipsum sample text..."
para = ap.text.TextParagraph()
para.first_line_indent = 20
para.rectangle = ap.Rectangle(80, 800, 400, 200, True)
para.formatting_options.wrap_mode = (
    ap.text.TextFormattingOptions.WordWrapMode.BY_WORDS
)

frag = ap.text.TextFragment(text)
frag.text_state.font = (
    ap.text.FontRepository.find_font("Times New Roman")
)
frag.text_state.font_size = 12

para.append_line(frag)
ap.text.TextBuilder(page).append_paragraph(para)

doc.save("paragraph_text.pdf")

import aspose.pdf as ap doc = ap.Document() page = doc.pages.add() text = "Lorem ipsum sample text..." para = ap.text.TextParagraph() para.first_line_indent = 20 para.rectangle = ap.Rectangle(80, 800, 400, 200, True) para.formatting_options.wrap_mode = ( ap.text.TextFormattingOptions.WordWrapMode.BY_WORDS ) frag = ap.text.TextFragment(text) frag.text_state.font = ( ap.text.FontRepository.find_font("Times New Roman") ) frag.text_state.font_size = 12 para.append_line(frag) ap.text.TextBuilder(page).append_paragraph(para) doc.save("paragraph_text.pdf")

๐Ÿงฉ Day 3 of my #PDFwithPython journey
Today I explored formatted paragraphs in Aspose.PDF for Python โ€” including indentation, wrapping.
๐Ÿง  What I learned:
- Paragraphs can have precise boundaries and indentation
- TextBuilder + TextParagraph = full layout control

#LearnPython #PDF #100DaysOfCode

4 0 0 0