I need it for doing CVs and job applications and that’s literally it.

  • nutsack@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    21 minutes ago

    I am composing my resume with markdown and then using a python script to produce a PDF. The result is vertical and clean and machine readable:

    #!/usr/bin/env python3
    """Convert Markdown files to PDF."""
    
    import argparse
    import sys
    from pathlib import Path
    
    try:
        import markdown
        from weasyprint import HTML, CSS
    except ImportError:
        print("Missing dependencies. Install with:")
        print("  pip install markdown weasyprint")
        sys.exit(1)
    
    
    CSS_STYLES = """
    @page {
        margin: 0.5in 0.6in;
        size: letter;
    }
    body {
        font-family: "Courier New", Courier, "Liberation Mono", monospace;
        font-size: 10pt;
        line-height: 1.4;
        color: #222;
        max-width: 100%;
    }
    h1, h2, h3 {
        margin-top: 1em;
        margin-bottom: 0.3em;
        padding-bottom: 0.2em;
    }
    h1 { font-size: 16pt; }
    h2 { font-size: 13pt; }
    h3 { font-size: 11pt; }
    h4 { font-size: 10pt; font-weight: normal; margin-bottom: 0.5em;}
    ul {
        margin: 0.3em 0;
        padding-left: 1.2em;
    }
    li {
        margin-bottom: 0.2em;
    }
    p {
        margin: 0.4em 0;
    }
    p + p {
        margin-top: 0.2em;
    }
    strong {
        font-weight: bold;
    }
    """
    
    
    PAGE_BREAK_MARKER = "<!-- pagebreak -->"
    PAGE_BREAK_HTML = '<div style="page-break-before: always;"></div>'
    
    
    def process_page_breaks(html_content: str) -> str:
        """Replace page break markers with actual page break HTML."""
        return html_content.replace(PAGE_BREAK_MARKER, PAGE_BREAK_HTML)
    
    
    def md_to_html(input_path: Path) -> str:
        """Convert a Markdown file to HTML content."""
        md_content = input_path.read_text(encoding="utf-8")
        html_content = markdown.markdown(md_content)
        return process_page_breaks(html_content)
    
    
    def convert_md_to_pdf(input_paths: list[Path], output_path: Path) -> None:
        """Convert one or more Markdown files to a single PDF."""
        html_parts = []
        for i, input_path in enumerate(input_paths):
            if i > 0:
                html_parts.append(PAGE_BREAK_HTML)
            html_parts.append(md_to_html(input_path))
    
        full_html = f"""
        <!DOCTYPE html>
        <html>
        <head><meta charset="utf-8"></head>
        <body>{"".join(html_parts)}</body>
        </html>
        """
    
        HTML(string=full_html).write_pdf(output_path, stylesheets=[CSS(string=CSS_STYLES)])
        print(f"Created: {output_path}")
    
    
    def main():
        parser = argparse.ArgumentParser(description="Convert Markdown files to PDF")
        parser.add_argument("files", nargs="*", type=Path, help="Markdown files to convert")
        parser.add_argument("-o", "--output", type=Path, help="Output PDF path")
        parser.add_argument("-m", "--merge", action="store_true", help="Merge all input files into a single PDF")
        args = parser.parse_args()
    
        # Default to all .md files in current directory
        files = args.files if args.files else list(Path(".").glob("*.md"))
    
        if not files:
            print("No Markdown files found")
            sys.exit(1)
    
        if args.merge:
            if not args.output:
                print("Error: --output is required when using --merge")
                sys.exit(1)
            for md_file in files:
                if not md_file.exists():
                    print(f"File not found: {md_file}")
                    sys.exit(1)
            convert_md_to_pdf(files, args.output)
        else:
            if args.output and len(files) > 1:
                print("Error: --output can only be used with a single input file (or use --merge)")
                sys.exit(1)
    
            for md_file in files:
                if not md_file.exists():
                    print(f"File not found: {md_file}")
                    continue
                output_path = args.output if args.output else md_file.with_suffix(".pdf")
                convert_md_to_pdf([md_file], output_path)
    
    
    if __name__ == "__main__":
        main()
    
  • Uffiz@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 hours ago

    There is FreeOffice which is germany based and WPS office which is asutralia based i think, they have a premium plan and a free plan,the free plan is pretty feature rich, for urself its plenty enough.

      • corsicanguppy@lemmy.ca
        link
        fedilink
        English
        arrow-up
        8
        ·
        9 hours ago

        I find it’s exactly identical to MSWord, but from the mso97 days before the Ribbon bollocks. I used o97 Word because it was like win3.1 Word … word-perfect? It’s been a while.

        But, TL/DR, LOWord is like Classic MSOffice from when it didn’t suck. This will not help you adjust, but hopefully the knowledge that you’re going back to a better era of UX could help blunt the pain.

        Go carefully, and have your favourite vice handy to goose the positive reinforcement loop.

    • Smoogs@lemmy.world
      link
      fedilink
      English
      arrow-up
      15
      ·
      20 hours ago

      Also if you’re using windows and avoiding acrobat try Sumatra for reading pdfs. FOSS is the way. Libre draw also does document signing for pdfs

  • solrize@lemmy.ml
    link
    fedilink
    arrow-up
    13
    ·
    18 hours ago

    Hardcore nerds use TeX but if I understand your question, you probably want LibreOffice. I’m unfamiliar with OnlyOffice so ok, maybe that’s good too.

  • sbird@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    11
    ·
    20 hours ago

    Both OnlyOffice and LibreOffice (Writer) would work. The main differences are that OnlyOffice has all the tools (documents, presentations, and spreadsheets) while LibreOffice separates them. LibreOffice also has an additional two tools: Draw (kind of like Adobe Illustrator or Inkscape) and Base (database stuff).

    Generally documents that are exported to and from MS Office will be better when working with OnlyOffice. If you aren’t doing a bunch of formatting that is absolutely critical (or no formatting at all), I wouldn’t worry about using LibreOffice. LibreOffice, for me, works well, but sometimes page break can happen a line or two earlier/later depending on how images, tables, headings, etc. are rendered, which is slightly annoying. In “Impress” (presentations), whenever I made one object transparent, ALL objects became transparent when viewing from MS Office, which was strange. That’s my experience, and it seems that other people have had similar formatting problems with LibreOffice too.

    Another thing that’s different is that, on Windows, LibreOffice doesn’t look very nice. On Linux, it looks fine (I selected “Tabbed”), but on Windows, I’m not sure if they’re using some other graphical package or something, but the top toolbar is all squished together with no wiggle room, even if you select “Tabbed”. One other thing, LibreOffice uses Qt so it will work with those themes in Linux (e.g. In KDE Plasma, which is what I run, LibreOffice will match with the system theme!)

    For a Linux-specific thing, it seems that LibreOffice doesn’t really like Wayland much, and was chugging and running at a jogging snail’s pace (certainly not a fast snail, this one), so I had to manually set the shortcut to run LibreOffice in XWayland or something like that anyways.

    One thing I like about LibreOffice is that there’s a few more plugins available than OnlyOffice. For example, LanguageTool has a LibreOffice plugin but don’t think there’s one for OnlyOffice. LibreOffice also has like a bazillion different settings to change how everything is rendered, you can change the order of the items in every toolbar and menu, I think Writer has a basic Java IDE built in too? Basically, LibreOffice is more customisable and configurable than OnlyOffice, and by a lot. OnlyOffice tries to be a little simpler than LibreOffice and I guess is more “dumbed down” with fewer buttons and settings?

    TLDR: LibreOffice has five separate programs, OnlyOffice has three in one. Files exported from OnlyOffice generally render with correct formatting on MS Office (and vice versa), the same may not be true for LibreOffice depending on the content of your documents. LibreOffice Windows isn’t nice (but looks better on Linux), LibreOffice doesn’t play nice with Wayland, LibreOffice has more plugins, options, etc.

      • sbird@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        4
        ·
        13 hours ago

        If you use Windows, yeah, LibreOffice doesn’t look all that nice. Setting it to “tabbed” view mode makes it a bit better (try that first)

        but the icons are still pretty small with little padding (on Windows at least. On Linux it is perfectly fine, so I use LibreOffice!). OnlyOffice will be more padded and has bigger icons than LibreOffice in Windows, yeah. I think it would work.

  • jeffw@lemmy.worldM
    link
    fedilink
    arrow-up
    25
    arrow-down
    1
    ·
    23 hours ago

    LibreOffice

    Or if you can spare $10-20 you can get a gray market Office key

  • lunarcat@lemmy.ca
    link
    fedilink
    arrow-up
    2
    arrow-down
    4
    ·
    9 hours ago

    Are we anti google docs here? I feel like it has everything word does and you can easily save/download files onto your computer as a PDF.

    If that doesn’t work, you can use word online! It’s basically MS word, you just can’t access it offline. It’s on the web.

  • mapleseedfall@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    20 hours ago

    Maybe not the exact answer: for CV and job applications I used latex with some template I found on the interwebs. Overleaf is a good latex provider

  • Mugita Sokio@lemmy.today
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    1
    ·
    23 hours ago

    Your best bet is either LibreOffice Writer, or OnlyOffice’s word processor. Another one I tried was Abiword, which is an old word processor.