# resizebox gives -> pdfTeX error (ext4): \pdfendlink ended up in different nesting level than \pdfstartlink. \end{document} [duplicate]

I'm working with a style in two columns. I would like to put a table fitting in one column as did in https://tex.stackexchange.com/questions/180543/creating-a-table-fitting-one-column-of-a-two-column-style-page.

However, if I use big strings as "large large large large large large" inside a \rotatebox, I have the error:

pdfTeX error (ext4): \pdfendlink ended up in different nesting level than \pdfstartlink. \end{document}

\begin{table}
\caption{Summary of the characteristics used in some related works.}
\label{tableRelatedWorks2}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{ccccccc}
\rotatebox[origin=c]{90}{\text{large large large large large large} }       & \text{KLSRf}   & \text{MLDFSP}       & \text{PNDND}       & \text{LDFSSVM}   & \rotatebox[origin=c]{90}{a}  & \rotatebox[origin=c]{90}{b}\\
\hline
\end{tabular}
}
\end{table}


If I put a string with 5 characters instead of "large large large large large large" in the code above, it works.

Someone could say what's wrong?

The error message has nothing to do with \resizebox. The error message is created by a link (e.g., see package hyperref) that is broken across pages. Links inside \resizebox never cross page borders.

It is just accidental that a different box size of a element on a page changes the page breaks in such a way that there is now a link across page borders.

Try to avoid links across page borders, they are not well supported by the drivers. Because they do not know, which elements on a page belongs to the link, they use a heuristic to get these elements. Heuristics can work in many cases, but they also fail.

• I did not understand your explanation. My error is in that code, if I change "!" by some "big" number, it works. – michael Apr 1 '18 at 16:07
• @michael By changing the height of the \resizebox you get different page breaks. The problem is the page break in the middle of a link. – Heiko Oberdiek Apr 1 '18 at 17:57

I found a solution:

We need to change the ! in the brackets because it keep the aspect ratio with \columnwidth. So, let's put some distance instead of !. Ex:

\begin{table}
\caption{Summary of the characteristics used in some related works.}
\label{tableRelatedWorks2}
\resizebox{\columnwidth}{10cm}{%
\begin{tabular}{ccccccc}
\rotatebox[origin=c]{90}{\text{large large large large large large} }       & \text{KLSRf}   & \text{MLDFSP}       & \text{PNDND}       & \text{LDFSSVM}   & \rotatebox[origin=c]{90}{a}  & \rotatebox[origin=c]{90}{b}\\
\hline
\end{tabular}
}
\end{table}


If 10 cm gives an error yet, just increase it.

So, I put some rows more to show the results. For my case, 5.5cm is ideal:

• if you scale both x and y you distort all the text? – David Carlisle Apr 1 '18 at 0:46
• yes, you need to find what is the nice combination for x and y. In that case, x = \columnwidth, so, changing y progressively will work. – michael Apr 1 '18 at 0:51
• No! scaling tables at all is to be avoided, scaling by different amounts in each direction should never be done unless you are distorting text for "fun" effects. – David Carlisle Apr 1 '18 at 9:39
• I put a picture to show my scaling. For any number below 5.5cm, I obtained the error. For some number bigger then 5.5, I will have distortions. – michael Apr 1 '18 at 15:55
• the error comes from page breaking in a link so the only relation with \resizebox is that it affects the size of the item on the page so adjusts the page breaking so some link elsewhere in the document gets broken over a page break. Heiko wrote the linking code, and I wrote \resizebox, and we are both telling you that \resizebox is not connected with the error. – David Carlisle Apr 1 '18 at 16:13