2

I have a set of pdfs in a folder, named: 1.pdf,2.pdf,3.pdf,...,20.pdf

Is it possible for mathematica to merge them to one pdf ? If yes, how ?

I had a look at this answer, but I don't really understand how to use it for my case: Combine multiple PDF files into one document

This is what I tried: I import the PDS:

pages = Import[ToString[#] <> ".pdf"] & /@ Range[20];

Then I use the code provided in the linked question:

Export["test.pdf", 
 CreateDocument[
  Riffle[Join[pages, pages], 
   Cell["", "PageBreak", PageBreakBelow -> True]], Visible -> False]]

but the result is that the "comma" is still visible next to each pdf and the pdf pages have been shrinked down by quiet a lot. ... and instead of being 20 pages, it is now 40 pages, each pdf page was printed twice.

enter image description here

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
james
  • 3,043
  • 13
  • 29
  • 5
    This feels like one of those cases where you should be using something else (e.g. pdftk). – J. M.'s missing motivation Oct 27 '17 at 12:31
  • @Kuba Please have a look at my updated question – james Oct 27 '17 at 12:48
  • Riffle[ Join @@ pages, Cell["", "PageBreak", PageBreakBelow -> True]. Notice that original pages were from one pdf, you have an array. – Kuba Oct 27 '17 at 13:01
  • @Kuba Thanks ! Now its 20 pages ! But it is still shrinked down, like in the image. – james Oct 27 '17 at 14:14
  • you may try the accepted solution at https://mathematica.stackexchange.com/questions/31780/export-list-elements-each-to-its-own-page-in-a-multi-paged-pdf-document, where the myList variable should be Flatten[pages] here – egwene sedai Oct 27 '17 at 16:17

0 Answers0