Hello, I'm trying to handle a special problem. I guess ConTeXt would be useful for this purpose, although its primary function is to typeset. But - I have many drawings - they are black-and-white one-sided PDFs of A1 or A2 size (typical technical drawings). The bottom right area of size 210 x 330 mm should be "deleted" - or over-painted by a white rectangle (or picture or MP code). And next a new PDF of A4 size should be placed on the right bottom area, just on the white ("deleting") area. I wouldn't have problem with batch processing the number of files. But I would need an example how to take the original A2 PDF, place a whitening area on it and then to place a new PDF over it; I'm not experienced enough in "layering" with ConTeXt and I guess this may be the way. Would it be possible to provide a small example of such processing an arbitrary file? I can send a sample A2 or A1 PDF, and also a replacing A4, if necessary. Thank you in advance. Kind regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
2011/1/11 Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
I'm trying to handle a special problem. I guess ConTeXt would be useful for this purpose, although its primary function is to typeset. But -
I have many drawings - they are black-and-white one-sided PDFs of A1 or A2 size (typical technical drawings).
The bottom right area of size 210 x 330 mm should be "deleted" - or over-painted by a white rectangle (or picture or MP code).
An important question: overpainted for your personal needs or in order to remove some information from PDF that others are not supposed to see? Mojca
Hello,
On Tue, 11 Jan 2011 17:45:53 +0100, Mojca Miklavec
An important question: overpainted for your personal needs or in order to remove some information from PDF that others are not supposed to see?
Mojca
I need to upgrade some drawings, or more precisely, to upgrade their title block as some its fields need to be changed (e.g. date 9/2010 to 1/2011, the "level" of the documentation and so on). Finally, the PDFs are to be printed to a physical printer (=> physical pieces of paper) and also to be provided to the third party like digital documents. The result should not have layers switchable to on/off, but I believe this can be handled by printing the final (even layered) PDF to another PDF by a virtual printer (e.g. pdfCreator). Layering was only an idea, which - as I believed - should lead to the goal; although that would probably mean to print the (layered) PDFs manually to the virtual PDF printer. Or is there another (non-layering or layer-merging) way? Regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On Tue, 11 Jan 2011, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Or is there another (non-layering or layer-merging) way?
You can also crop the pdf (\clip[mp=shape that you want to clip]{\externalfigure[...]}) and place that on paper using layers. That way, even if layers are toggled on a pdfviewer, the reader will see blank text (as opposed to old text). But, I believe that clipping still inserts the whole pdf, so if someone really wanted, they can still extract out the original pdf. So this is not a failsafe way of hiding information; but is better than just adding a layer over the title. Aditya
On 11-1-2011 6:59, Aditya Mahajan wrote:
On Tue, 11 Jan 2011, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Or is there another (non-layering or layer-merging) way?
You can also crop the pdf (\clip[mp=shape that you want to clip]{\externalfigure[...]}) and place that on paper using layers. That way, even if layers are toggled on a pdfviewer, the reader will see blank text (as opposed to old text).
or just overlay framed with a white background ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi,
Finally, the PDFs are to be printed to a physical printer (=> physical pieces of paper) and also to be provided to the third party like digital documents. The result should not have layers switchable to on/off, but I believe this can be handled by printing the final (even layered) PDF to another PDF by a virtual printer (e.g. pdfCreator).
Layering was only an idea, which - as I believed - should lead to the goal; although that would probably mean to print the (layered) PDFs manually to the virtual PDF printer.
Or is there another (non-layering or layer-merging) way?
if you want to get rid of some part of PDF documents and if they are not too many, you can try to import them in Inkscape editor and really delete what is unwanted. Regards Zdeněk
2011/1/11 Procházka Lukáš Ing. - Pontex s. r. o.
Hello,
I'm trying to handle a special problem. I guess ConTeXt would be useful for this purpose, although its primary function is to typeset. But -
I have many drawings - they are black-and-white one-sided PDFs of A1 or A2 size (typical technical drawings).
The bottom right area of size 210 x 330 mm should be "deleted" - or over-painted by a white rectangle (or picture or MP code).
And next a new PDF of A4 size should be placed on the right bottom area, just on the white ("deleting") area.
I wouldn't have problem with batch processing the number of files.
But I would need an example how to take the original A2 PDF, place a whitening area on it and then to place a new PDF over it; I'm not experienced enough in "layering" with ConTeXt and I guess this may be the way.
Would it be possible to provide a small example of such processing an arbitrary file? I always use this as starting point http://wiki.contextgarden.net/Layers -- luigi
Procházka Lukáš Ing. - Pontex s. r. o.
Would it be possible to provide a small example of such processing an arbitrary file?
Yes.
I can send a sample A2 or A1 PDF, and also a replacing A4, if necessary.
Not necessary, context can produce such files for you. Example, using positioning macros, that shows also a problem with vertical offset: --8<---------------cut here---------------start------------->8--- % Produce A2-example: \startbuffer[a2] \setuppapersize[A2] \setuplayout[page] \setupbackgrounds[page][background=color, backgroundcolor=blue] \starttext \input tufte \stoptext \stopbuffer \savebuffer[a2][a2-page.tex] \executesystemcommand{context a2-page} % Produce A4-example: \startbuffer[a4] \setuppapersize[A4] \setuplayout[page] \starttext \input tufte \stoptext \stopbuffer \savebuffer[a4][a4-page.tex] \executesystemcommand{context a4-page} % Do the job: \setuppapersize[A2] \setuplayout[page] \setuppositioning[state=overlay, yoffset=-12pt%%%%%%%%%%%%%%%%%%%%%%% Why is this offset needed??? ] \starttext \startpositioning \position(0,0){\externalfigure[a2-page]} \position(0,0){\framed[frame=off, offset=overlay, background=color, backgroundcolor=white]{\externalfigure[a4-page]}} \stoppositioning \stoptext --8<---------------cut here---------------end--------------->8--- -- Peter Münster Contact information: http://pmrb.free.fr/contact/
Hello,
thanks to all for the answers, Peter's solution is closest to that I need. My code now is:
---
\setuppapersize[A1,landscape]
\setuplayout[page]
\setuppositioning
[state=overlay,
yoffset=-12pt % Why?
]
\starttext
\startpositioning
\position(0,0){\rotate[rotation=90]{\externalfigure[TvNK]}}
\position(630mm,297mm){\framed[frame=off,offset=overlay,background=color,backgroundcolor=white]
{\externalfigure[_R]}}
\stoppositioning
\stoptext
---
I'd still have two questions:
- Is it possible to determine the size of the PDF being inserted (in my case the "TvNK", which is A1)? I'd need to know this because depending on this, I'd need to \setuppapersize[<size-of-PDF-to-be-inserted>,landscape].
- Is it possible to "move" the origin for \positioning to the right bottom corner? It's not "fatal" to know it, as having the PDF size known, I can evaluate 630mm = width.of.A1 - width.of.A4 and 297 = height.of.A1 - height.of.A4; I'm just curious.
Best regards,
Lukas
On Tue, 11 Jan 2011 21:32:12 +0100, Peter Münster
Not necessary, context can produce such files for you.
Example, using positioning macros, that shows also a problem with vertical offset:
--8<---------------cut here---------------start------------->8--- % Produce A2-example: \startbuffer[a2] \setuppapersize[A2] \setuplayout[page] \setupbackgrounds[page][background=color, backgroundcolor=blue] \starttext \input tufte \stoptext \stopbuffer \savebuffer[a2][a2-page.tex] \executesystemcommand{context a2-page}
% Produce A4-example: \startbuffer[a4] \setuppapersize[A4] \setuplayout[page] \starttext \input tufte \stoptext \stopbuffer \savebuffer[a4][a4-page.tex] \executesystemcommand{context a4-page}
% Do the job: \setuppapersize[A2] \setuplayout[page] \setuppositioning[state=overlay, yoffset=-12pt%%%%%%%%%%%%%%%%%%%%%%% Why is this offset needed??? ] \starttext \startpositioning \position(0,0){\externalfigure[a2-page]} \position(0,0){\framed[frame=off, offset=overlay, background=color, backgroundcolor=white]{\externalfigure[a4-page]}} \stoppositioning \stoptext --8<---------------cut here---------------end--------------->8---
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
Am 12.01.2011 um 09:39 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Hello,
thanks to all for the answers, Peter's solution is closest to that I need. My code now is:
--- \setuppapersize[A1,landscape] \setuplayout[page] \setuppositioning [state=overlay, yoffset=-12pt % Why? ]
\starttext \startpositioning \position(0,0){\rotate[rotation=90]{\externalfigure[TvNK]}} \position(630mm,297mm){\framed[frame=off,offset=overlay,background=color,backgroundcolor=white] {\externalfigure[_R]}} \stoppositioning \stoptext ---
I'd still have two questions:
- Is it possible to determine the size of the PDF being inserted (in my case the "TvNK", which is A1)? I'd need to know this because depending on this, I'd need to \setuppapersize[<size-of-PDF-to-be-inserted>,landscape].
- Is it possible to "move" the origin for \positioning to the right bottom corner? It's not "fatal" to know it, as having the PDF size known, I can evaluate 630mm = width.of.A1 - width.of.A4 and 297 = height.of.A1 - height.of.A4; I'm just curious.
\define[2]\Replacement {\startTEXpage[background={foreground,replacement}]% \layeredtext [corner={right,bottom},location={left,top}] [background=color,backgroundcolor=white,offset=0pt] {\externalfigure[#2]} {\externalfigure[#1]} \stopTEXpage} \useexternalfigure[big] [hacker][scale=3000] \useexternalfigure[small][cow] \starttext \Replacement{big}{small} \stoptext \layeredtext is described in the details manuals. Wolfgang
Hello,
thanks for the code.
On Wed, 12 Jan 2011 10:30:39 +0100, Wolfgang Schuster
\define[2]\Replacement {\startTEXpage[background={foreground,replacement}]% \layeredtext [corner={right,bottom},location={left,top}] [background=color,backgroundcolor=white,offset=0pt] {\externalfigure[#2]} {\externalfigure[#1]} \stopTEXpage}
\useexternalfigure[big] [hacker][scale=3000] \useexternalfigure[small][cow]
\starttext \Replacement{big}{small} \stoptext
\layeredtext is described in the details manuals.
Which exactly do you mean? I searched for some information about "\layeredtext" and "\startTEXpage[background=". I tried wiki, contextref.pdf and google, also several from http://www.pragma-ade.com/show-man-1.htm, but I'm not much smarter so far. Best regards, Lukas
Wolfgang
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
2011/1/12 Procházka Lukáš Ing. - Pontex s. r. o.
Hello,
thanks for the code.
On Wed, 12 Jan 2011 10:30:39 +0100, Wolfgang Schuster
wrote: \define[2]\Replacement {\startTEXpage[background={foreground,replacement}]% \layeredtext [corner={right,bottom},location={left,top}] [background=color,backgroundcolor=white,offset=0pt] {\externalfigure[#2]} {\externalfigure[#1]} \stopTEXpage}
\useexternalfigure[big] [hacker][scale=3000] \useexternalfigure[small][cow]
\starttext \Replacement{big}{small} \stoptext
\layeredtext is described in the details manuals.
Which exactly do you mean? I searched for some information about "\layeredtext" and "\startTEXpage[background=". I tried wiki, contextref.pdf and google, also several from http://www.pragma-ade.com/show-man-1.htm, but I'm not much smarter so far.
Best regards,
Lukas maybe http://www.pragma-ade.com/general/manuals/details.pdf
-- luigi
Am 12.01.2011 um 11:56 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Hello,
thanks for the code.
On Wed, 12 Jan 2011 10:30:39 +0100, Wolfgang Schuster
wrote: \define[2]\Replacement {\startTEXpage[background={foreground,replacement}]%
{\startTEXpage
\layeredtext [corner={right,bottom},location={left,top}] [background=color,backgroundcolor=white,offset=0pt] {\externalfigure[#2]} {\externalfigure[#1]} \stopTEXpage}
\useexternalfigure[big] [hacker][scale=3000] \useexternalfigure[small][cow]
\starttext \Replacement{big}{small} \stoptext
\layeredtext is described in the details manuals.
Which exactly do you mean? I searched for some information about "\layeredtext" and "\startTEXpage[background=".
You don’t need “backround={…}”, it’s a leftover from a earlier attempt to find a nice solution to your problem. \startTEXpage … \stopTEXpage produce a separate page for it’s content where the page is a large as the content itself, try: \starttext \input knuth\par \startTEXpage[width=10cm] \input knuth\par \stopTEXpage \input knuth\par \stoptext
I tried wiki, contextref.pdf and google, also several from http://www.pragma-ade.com/show-man-1.htm, but I'm not much smarter so far.
participants (8)
-
Aditya Mahajan
-
Hans Hagen
-
luigi scarso
-
Mojca Miklavec
-
pmlists@free.fr
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Wolfgang Schuster
-
zs