Merging PDF document of various page sizes. Can ConTeXt help?
Hello community, I have the following problem. I need to create a single PDF file where each page may have a different size and orientation. Say the first page is A4 portrait, the second is A3 landscape and so on. Can ConTeXr help? Each page contains a PDF image of some random size that is inserted. I have been looking around for a solution but haven't found one. I also tried Create.app, the drawing program. And I tried a program call PDF Merge and some others. Neither of these work, and most of the merge programs out there maybe merged, but changed the nice vector images into pixel images, completely destroying print quality. So, I am back where I started. Is there some fancy ConTeXt trickery I could use to do this? Summary: - One PDF as result - Each page has a different size and orientation - Each page contains a PDF vector image that is not to be converted to pixels Yours, G
On Fri, Jan 13, 2012 at 4:20 PM, Gerben Wierda
Hello community,
I have the following problem. I need to create a single PDF file where each page may have a different size and orientation. Say the first page is A4 portrait, the second is A3 landscape and so on. Can ConTeXr help? Each page contains a PDF image of some random size that is inserted.
I have been looking around for a solution but haven't found one. I also tried Create.app, the drawing program. And I tried a program call PDF Merge and some others. Neither of these work, and most of the merge programs out there maybe merged, but changed the nice vector images into pixel images, completely destroying print quality.
So, I am back where I started. Is there some fancy ConTeXt trickery I could use to do this?
Summary: - One PDF as result - Each page has a different size and orientation - Each page contains a PDF vector image that is not to be converted to pixels
So , if you have file-001.pdf, file-002.pdf, file-003.pdf maybe \starttext \startTEXpage\externalfigure[file-001]\stopTEXpage \startTEXpage\externalfigure[file-002]\stopTEXpage \startTEXpage\externalfigure[file-003]\stopTEXpage \stoptext is what you need. -- luigi
On Fri, Jan 13, 2012 at 16:20, Gerben Wierda
Hello community,
I have the following problem. I need to create a single PDF file where each page may have a different size and orientation. Say the first page is A4 portrait, the second is A3 landscape and so on. Can ConTeXr help? Each page contains a PDF image of some random size that is inserted.
I have been looking around for a solution but haven't found one. I also tried Create.app, the drawing program. And I tried a program call PDF Merge and some others. Neither of these work, and most of the merge programs out there maybe merged, but changed the nice vector images into pixel images, completely destroying print quality.
So, I am back where I started. Is there some fancy ConTeXt trickery I could use to do this?
Summary: - One PDF as result - Each page has a different size and orientation - Each page contains a PDF vector image that is not to be converted to pixels
Yes, this is easy. There are three options: 1.) \startTEXpage\externalfigure[...]\stopTEXpage 2.) same, but with TEXstream 3.) a shortcut for the above, \startpagefigure. See http://wiki.contextgarden.net/Including_pages_from_PDF_document Mojca
Answering my own question, quite simple with ConTeXt: \definepapersize[a3landscape][A3,landscape] \definepapersize[a4portrait][A4,portrait] \setuppapersize[a4portrait] \starttext \externalfigure[foo.pdf] \page\setuppapersize[a3landscape] \externalfigure[bar.pdf] \stoptext G PS. The solution below does not work because it keeps the sizes of the images and does not set page sizes for the pages where the images are embedded. On 13 Jan 2012, at 16:33, Victor Ivrii wrote:
NO, AR cannot do this.
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf source1.pdf source2.pdf source3.pdf
works
with TeX one can use attachfile2 package (may be attachfile also works) to create pdf bundle (aka portfolio). ======
However this is a question of combining. I remember that there is a LaTeX package - cannot recall its name - which changes the size on the fly (inside of document)
Victor ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faq List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/ List Archive: http://tug.org/pipermail/macostex-archives/ TeX on Mac OS X Website: http://mactex-wiki.tug.org/ List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex On 13 Jan 2012, at 16:27, Mojca Miklavec wrote:
On Fri, Jan 13, 2012 at 16:20, Gerben Wierda
wrote: Hello community,
I have the following problem. I need to create a single PDF file where each page may have a different size and orientation. Say the first page is A4 portrait, the second is A3 landscape and so on. Can ConTeXr help? Each page contains a PDF image of some random size that is inserted.
I have been looking around for a solution but haven't found one. I also tried Create.app, the drawing program. And I tried a program call PDF Merge and some others. Neither of these work, and most of the merge programs out there maybe merged, but changed the nice vector images into pixel images, completely destroying print quality.
So, I am back where I started. Is there some fancy ConTeXt trickery I could use to do this?
Summary: - One PDF as result - Each page has a different size and orientation - Each page contains a PDF vector image that is not to be converted to pixels
Yes, this is easy. There are three options:
1.) \startTEXpage\externalfigure[...]\stopTEXpage 2.) same, but with TEXstream 3.) a shortcut for the above, \startpagefigure. See http://wiki.contextgarden.net/Including_pages_from_PDF_document
Mojca ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On Fri, Jan 13, 2012 at 4:44 PM, Gerben Wierda
Answering my own question, quite simple with ConTeXt:
\definepapersize[a3landscape][A3,landscape] \definepapersize[a4portrait][A4,portrait] \setuppapersize[a4portrait] \starttext \externalfigure[foo.pdf] \page\setuppapersize[a3landscape] \externalfigure[bar.pdf] \stoptext
G
PS. The solution below does not work because it keeps the sizes of the images and does not set page sizes for the pages where the images are embedded.
Ah ok, you don't want to inherit the pagesize from the external pdf. -- luigi
It still is weird. It sometimes work (but not completely) and sometimes not. For instance \definepapersize[a3landscape][A3,landscape] \definepapersize[a4portrait][A4,portrait] \setuppapersize[a3landscape] \starttext \externalfigure[foo.pdf] \stoptext foo.pdf is a 18.43x13.88 inch PDF image The end result is a 16.54x16.54 inch PDF image with the embedded image cropped. ?? G On 13 Jan 2012, at 16:47, luigi scarso wrote:
On Fri, Jan 13, 2012 at 4:44 PM, Gerben Wierda
wrote: Answering my own question, quite simple with ConTeXt: \definepapersize[a3landscape][A3,landscape] \definepapersize[a4portrait][A4,portrait] \setuppapersize[a4portrait] \starttext \externalfigure[foo.pdf] \page\setuppapersize[a3landscape] \externalfigure[bar.pdf] \stoptext
G
PS. The solution below does not work because it keeps the sizes of the images and does not set page sizes for the pages where the images are embedded.
Ah ok, you don't want to inherit the pagesize from the external pdf.
-- luigi
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Weirder still. \definepapersize[large][a3,landscape] \definepapersize[small][a4,portrait] \setuppapersize[large] \starttext \externalfigure[foo.pdf] \page\setuppapersize[small] \externalfigure[bar.pdf] \stoptext The first page is now 11.69x11.69 inch and the second page is a4, but landscape So, let's make sure I use both layout size and print size in my definitions \definepapersize[large][a3,landscape][a3,landscape] \definepapersize[small][a4,portrait][a4,portrait] \setuppapersize[large] \starttext \externalfigure[foo.pdf][factor=fit] \page\setuppapersize[small] \externalfigure[bar.pdf][factor=fit] \stoptext Now both pages are a4 landscape. Another go: \setuppapersize[a3,landscape][a3,landscape] \starttext \externalfigure[BoudewijndeHaasOpgave2Totaalview.pdf][factor=fit] \page\setuppapersize[a4,portrait][a4,portrait] \externalfigure[FredRademakerOpgave2Totaalview.pdf][factor=fit] \stoptext Both a4 landscape again. Does this stuff work at all? Another go \setuppapersize[A3,landscape][A3,landscape] \starttext \externalfigure[foo.pdf][factor=fit] \page\setuppapersize[A4,portrait][A4,portrait] \externalfigure[bar.pdf][factor=fit] \stoptext Hmm, this works. I originally used lower case a4 and a3, as I saw that in an example somewhere. But somewhere else I saw A3, A4 etc. G On 13 Jan 2012, at 18:15, Gerben Wierda wrote:
It still is weird. It sometimes work (but not completely) and sometimes not. For instance
\definepapersize[a3landscape][A3,landscape] \definepapersize[a4portrait][A4,portrait] \setuppapersize[a3landscape] \starttext \externalfigure[foo.pdf] \stoptext
foo.pdf is a 18.43x13.88 inch PDF image The end result is a 16.54x16.54 inch PDF image with the embedded image cropped.
??
G
On 13 Jan 2012, at 16:47, luigi scarso wrote:
On Fri, Jan 13, 2012 at 4:44 PM, Gerben Wierda
wrote: Answering my own question, quite simple with ConTeXt: \definepapersize[a3landscape][A3,landscape] \definepapersize[a4portrait][A4,portrait] \setuppapersize[a4portrait] \starttext \externalfigure[foo.pdf] \page\setuppapersize[a3landscape] \externalfigure[bar.pdf] \stoptext
G
PS. The solution below does not work because it keeps the sizes of the images and does not set page sizes for the pages where the images are embedded.
Ah ok, you don't want to inherit the pagesize from the external pdf.
-- luigi
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On Fri, 13 Jan 2012, Gerben Wierda wrote:
Hello community,
I have the following problem. I need to create a single PDF file where each page may have a different size and orientation. Say the first page is A4 portrait, the second is A3 landscape and so on. Can ConTeXr help? Each page contains a PDF image of some random size that is inserted.
I have been looking around for a solution but haven't found one. I also tried Create.app, the drawing program. And I tried a program call PDF Merge and some others. Neither of these work, and most of the merge programs out there maybe merged, but changed the nice vector images into pixel images, completely destroying print quality.
So, I am back where I started. Is there some fancy ConTeXt trickery I could use to do this?
Summary: - One PDF as result - Each page has a different size and orientation - Each page contains a PDF vector image that is not to be converted to pixels
In the past I have used pdftk to merge pdfs and found it to be pretty reliable. Aditya
I did not see the possibility to influence page sizes of the PDF's you merge in the man page. G On 13 Jan 2012, at 23:43, Aditya Mahajan wrote:
On Fri, 13 Jan 2012, Gerben Wierda wrote:
Hello community,
I have the following problem. I need to create a single PDF file where each page may have a different size and orientation. Say the first page is A4 portrait, the second is A3 landscape and so on. Can ConTeXr help? Each page contains a PDF image of some random size that is inserted.
I have been looking around for a solution but haven't found one. I also tried Create.app, the drawing program. And I tried a program call PDF Merge and some others. Neither of these work, and most of the merge programs out there maybe merged, but changed the nice vector images into pixel images, completely destroying print quality.
So, I am back where I started. Is there some fancy ConTeXt trickery I could use to do this?
Summary: - One PDF as result - Each page has a different size and orientation - Each page contains a PDF vector image that is not to be converted to pixels
In the past I have used pdftk to merge pdfs and found it to be pretty reliable.
Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On Fri, 13 Jan 2012, Gerben Wierda wrote:
I did not see the possibility to influence page sizes of the PDF's you merge in the man page.
I thought that you did not want to influence the page size. From what I remember, pdftk does not change page sizes, it simply merges the pdfs. Aditya
I wrote: - One PDF as result - Each page has a different size and orientation - Each page contains a PDF vector image that is not to be converted to pixels I have looked at many tools: All so far do not leave vector images vector images, they convert to pixels and at a pretty low resolution at that. All so far looked at do not ignore page sizes, they set a page size for the entire document. Anyway, ConTeXt is capable, though it is difficult to get it working properly because its arguments cannot stand combinations of fit-to-size and rotation in combination. But with a lot of specific hand work and nudging, I can get there eventually. G On 14 Jan 2012, at 00:03, Aditya Mahajan wrote:
On Fri, 13 Jan 2012, Gerben Wierda wrote:
I did not see the possibility to influence page sizes of the PDF's you merge in the man page.
I thought that you did not want to influence the page size. From what I remember, pdftk does not change page sizes, it simply merges the pdfs.
Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (4)
-
Aditya Mahajan
-
Gerben Wierda
-
luigi scarso
-
Mojca Miklavec