1

I'm doing some tests with iTextSharp to see it would work to automate a workflow I have. So, I am using Pandoc to generate some pdfs from markdown. But when I generate the files iTextSharp doesn't recognize the fields I have generated. It recognizes the fields in a different pdf I didn't create so I figure it is something that I am doing wrong.

Solution:

I guess I needed the form wrapper around it:

\begin{Form}

My field: \underline{\TextField[name=AField]{}}

\end{Form}

So, I start with this code in Test.md:

My field: \underline{\TextField[name=AField]{}}

If I use this command pandoc -s .\Test.md -o Test.tex to generate the tex file I get this result:

... see pre code below if this part of the latex file matter to you

\begin{document}

My field: \underline{\TextField[name=AField]{}}

\end{document}

Of course, I use this command pandoc -s .\Test.md -o Test.pdf to actually generate the pdf. Should I be using a different command to generate the TextField?

Code generated in tex file not included above for brevity:

\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provides euro and other symbols
\else % if luatex or xelatex
  \usepackage{unicode-math}
  \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
}
\usepackage{hyperref}
\hypersetup{
            pdfborder={0 0 0},
            breaklinks=true}
\urlstyle{same}  % don't use monospace font for urls
\setlength{\emergencystretch}{3em}  % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi

% set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother


\date{}

Note: I asked this question over on StackOverflow but it is probably better here.

0

I guess I needed the form wrapper around it:

\begin{Form}

My field: \underline{\TextField[name=AField]{}}

\end{Form}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.