[pdftex] Handwritten pdf graphics

Tobias Haustein tobias.haustein at aixigo.de
Wed Oct 16 13:31:32 CEST 2002


Hans Hagen wrote:

> you can encapsulate whatever you want in an xform and add resources to
> that, works ok here (for shading, patterns, transparency and whatever)

Yes, but I cannot add things to the page resources, if pdfTeX uses the same
type of resource in the same page. So if some time pdfTeX supports patterns,
my patterns don't work any longer. Example: 


\documentclass[a4paper]{article}

\pdfcompresslevel0

\begin{document}

\immediate\pdfobj{
[ /Pattern /DeviceRGB ]
}
\immediate\pdfobj{
<< 
 /Type /Pattern 
 /PatternType 1 % Tiling pattern 
 /PaintType 2 % Colored
 /TilingType 1
 /BBox [0 0 101 101] 
 /XStep 100 
 /YStep 100 
 /Resources << >>
 /Matrix [0.025 0 0 0.025 0 0]
 /Length 61
>>
stream^^J%
s 0 0 m 100 100 l 100 70 l 30 0 l F 0 100 m 30 100 l 0 70 l F^^J%
endstream
}
\pdfpageresources{/ColorSpace << /Cs1 1 0 R >> /Pattern << /P1 2 0 R >>}
\pdfliteral{q /Cs1 cs 0 1 0 /P1 scn 0 -100 100 -100 re B 0 0 1 /P1 scn 35 -70
100 -100 re B Q}
\mbox{}
\end{document}


This works, but there are some problems:

1. I should use \pdflastobj, but no macros are evaluated inside of
\pdfpageresources (this is no problem of pdfTeX, but of my incompetence).

2. The last call to \pdfpageresources overrides the previous resources. We
could of course use the "\the" operator, to read the previous resources and
append our new resources, but then we could end with duplicate resource
definitions (e.g. package A and B both define a "/Pattern" resource, then we
end with two "/Pattern" entries in the directory which leads to an invalid PDF
document).

3. The same holds for page resources that are used by pdfTeX. For todays
pdfTeX versions, the problem occurs only if we use /Font or /Image resources,
but in future versions, pdfTeX may make use of colorspaces or other features.
If we declare a /Font resource, pdfTeX adds its own /Font resource to the page
directory and the PDF document is invalid.



> undocumented experimental feature: \pdfincludechars\font{a} b

We make use of this command, but it does not reference the font in the current
page. Thus, the font is not included in the current page resource directory.
Since we cannot add it on our own (see problem 3 above), we have to use the
clipping trick.



> tex does not have the concept of a space character, only of glue (of course
> you can include a space char explicitly, given that your font has one)

It seems, that \pdfincludechars does not allow us to include the space
character (at least in pdfTeX 1.00a-pretest). I think that it worked in
Version 0.13d).



> or a printer problem, i never had problems with pdf images

Probably, but I had never problems with PDF documents from external resources.
I'm going to do a bit-by-bit comparison of a printable and an unprintable file
in order to find the problem.


Ciao,

Tobias Haustein

--
Dipl. Inform. Tobias Haustein

aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-40, fax: +49 (0)241 936737-99
eMail: tobias.haustein at aixigo.de, web: http://www.aixigo.de



More information about the pdftex mailing list