TransWikia.com

Pixelated PDF using basic-scheme?

TeX - LaTeX Asked by grr473 on April 18, 2021

I’m producing a PDF using Python 3.7 inside a Docker container and the result is pixelated (using adobe’s pdf viewer). I’m wondering if me using TexLive basic-scheme and with the added packages shown below (some of which might be redundant, not sure) might cause this or not? I’ve prepared a similar question for stack overflow, but I’m holding on to it incase this might be a pure tex-related issue.

  • latexmk
  • latex
  • fmtcount
  • xkeyval
  • totpages
  • ifmtarg
  • etoolbox
  • tools
  • babel-swedish
  • xcolor
  • booktabs
  • hyperref
  • hyperxmp
  • eurosym
  • datetime
  • geometry
  • titlesec
  • chngcntr
  • fancyhdr
  • enumitem

Edit 2: I should also mention that my program renders the PDF using these commands:

latexmk -pdf -recorder filename.tex

And I’ve also tried:

pdflatex -interaction=nonstopmode filename.tex

(I don’t need to run it twice now, as I believe recorder does for latexmk, but I might need it in the future)

Edit 1: Removed useless close-ups of the pixels and shared links to pdf examples as suggested. I am however unsure how to best present a proper MWE so that the problem can be reproduced. However, here below is the Latex part:

Style-file:

ProvidesPackage{styfile}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[swedish]{babel}
usepackage{graphicx}
usepackage{xcolor}
usepackage{longtable}
setlengthLTleft{0pt}
setlengthLTright{0pt}
usepackage{booktabs}
usepackage{array}
usepackage{multicol}
newcommand{mc}[2]{multicolumn{#1}{l}{#2}}
newcolumntype{R}{>{raggedleftarraybackslash}p{0.1textwidth}}
usepackage[
    pdfborder={0 0 0},
    colorlinks={true},
    linkcolor={black},
    urlcolor={blue}
]{hyperref}
usepackage{hyperxmp}
usepackage[yyyymmdd]{datetime}
usepackage[bottom=25mm, footskip=30pt, top=110pt, headheight=150pt, headsep=5mm, left=25mm, right=25mm]{geometry}
usepackage{calc}


usepackage{fancyhdr}
definecolor{footercolor}{HTML}{C0504D}
newlength{myoddoffset}
setlength{myoddoffset}{marginparwidth}

fancypagestyle{presentation}{%
    fancyheadoffset[loh,reh]{myoddoffset}
    renewcommand{headrulewidth}{0pt}
    rhead{}
    lfoot{footnotesize textbf{unit{}, today}  {color{footercolor}Company $cdot$ Address 1 $cdot$ Address 2 $cdot$ Phone $cdot$ Web}}
    cfoot{}
}

fancypagestyle{plain}{%
    renewcommand{headrulewidth}{0pt}
    lhead{}
    lfoot{footnotesize textbf{unit{}, today}  {color{footercolor}Company $cdot$ Address 1 $cdot$ Address 2 $cdot$ Phone $cdot$ Web}}
    cfoot{}
}

Main file:

documentclass[a4paper, 10pt]{article}

usepackage{styfile}

newcommand{unit}{Unit}
newcommand{unitdetail}{Unit details}
newcommand{name}{Name Surname}
newcommand{role}{Role} 
newcommand{phone}{555-36356}
newcommand{email}{[email protected]}
newcommand{employmentyear}{2020}
newcommand{presentationtext}{Short descriptive text}


newcommand{portrait}{img/default.png}
renewcommand{dateseparator}{--}

begin{document}
thispagestyle{presentation}
pagestyle{plain}
noindent
begin{minipage}[t]{0.3textwidth}
    strutvspace*{-baselineskip}newline
    begin{tabular*}{1linewidth}{p{1linewidth}}
        {LARGE Curriculum vitae}
        includegraphics[width=120pt, height=120pt]{portrait} 
        textbf{name} 
        role{} 
        unitdetail{} 
        
        textbf{Contact} 
        phone{} 
        href{mailto:email}{email} 
    end{tabular*}
end{minipage}%
hfill
begin{minipage}[t]{0.6textwidth}
    strutvspace*{-baselineskip}newline
    begin{tabular*}{1linewidth}{p{0.7linewidth} r}
        {Large Presentation} & 
        mc{2}{presentationtext} 
        textbf{Employment at company} & 
        employmentyear & 
        & 
        textbf{Previous Employments}& 
        Company 1 & 2020
        & 
        textbf{Education} & 
        Education 1 & 2020 
        & 
        textbf{Courses}& 
        Course 1 & 2020 
    end{tabular*}
end{minipage}
mbox{ }
begin{longtable}{@{extracolsep{fill}}p{0.2textwidth} p{0.65textwidth} Rp{0.1textwidth}}
    {large Reference Assignment } & {large Description} & {large Time} 
    toprule
    endfirsthead

    {large Reference Assignment } & {large Description} & {large Time} 
    toprule
    endhead

    bottomrule
    endlastfoot

    Assignment 1

    &
    Description 1
    &
    2020
     midrule
end{longtable}
end{document}

non-pixelated pdf

pixelated pdf

One Answer

Your pixelated PDF uses a different font (Type 3), which is indeed a pixel font that will not scale well. The nonpixel PDF uses Type 1 fonts, which are vector based.

Specifying a font or, as you have discovered, installing a Type 1 variant of Computer Modern should solve the issue.

Correct answer by Ingmar on April 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP