1

I am writing a replacement for \include that will only include the file if it has been modified. To do this I need to delete or extract files from a pdf. I am using lua to do all this.

I see there are some cmd line tools to do it: http://www.verypdf.com/wordpress/201112/delete-specified-pdf-pages-using-command-line-15756.html

But is there any easier way? Ultimately I would like to extract/copy only a subset of pages from a pdf to a new pdf rather than copy the whole file(which may be large) into another then delete the pages.

Uiy
  • 6,132
  • 1
  • @Jake I'm trying to do much more than that... make a conditional include or includepdf – Uiy May 13 '12 at 20:38
  • Sorry, I should have been clearer: I meant that you can use \includepdf[pages=...] to specify which pages to include. – Jake May 13 '12 at 20:42
  • @Jake Yes, I know that. I will use it, but I am trying to trim down the pdf's in the first place so it is quicker and they take up less space. – Uiy May 13 '12 at 20:59
  • Ah, okay. In that case, the question is probably off topic for this site and should be migrated to Superuser.com. – Jake May 13 '12 at 21:01
  • \includepdf will only include the selected pages, not the whole PDF, so trimming is not required. Also it shouldn't be any issue to have two copies of the output PDF except if these are really large. – Martin Scharrer May 13 '12 at 21:23
  • @MartinScharrer Sorry, you don't get what I'm trying to do. I am trying to create a pdf for each include in the main tex file. This means I am trying to extract the pages that each include covers to its own pdf. – Uiy May 13 '12 at 22:04
  • 1
    If you know the page numbers of the pieces you want to extract the answer here might help: http://tex.stackexchange.com/questions/54157/compiling-master-and-individual-child-documents-with-correct-pagination/54227#54227 – Ethan Bolker May 14 '12 at 00:40
  • @EthanBolker yep, I found pdftk and started using that... there was another but wasn't free. pdftk works fine but just have to be able to call it from lutex. – Uiy May 14 '12 at 01:11

0 Answers0