everybody!
I usually output .RMarkdown as html file and use the following to create an in-text table.
variable|Description
--------|-----------
`var1` |abcdefg
`var2` |gfedcba
But it doesn't apply to pdf output. Because I want to keep variable names as var1, I prefer not to use code chunk to generate the table. I also tried Latex syntax and something I found online (e.g. below). However, none of these approaches works.
variable Description
-------- --------------
`var1` abcdefg
`var2` gfedcba
-------- --------------
|variable|Description|
|:-------|----------:|
|`var1` |abcdefg |
|`var2` |gfedcba |
It shouldn't be this twisted. Does anybody have a simple solution to this? Thank you very much!
There is a hack that can solve your problem. Export the file as HTML format (as it works fine in this way), open the file on browser and print[CTRL+P] and save as pdf.
I have 2 LDIF output prepared to one line each object separated by "|" and all attribut fields are sorted.
I want to write first field contain dn: when a field is missing or has a different value in second file. If it's missing i need a marker add and a marker replace if it's different. If all fields are identical, nothing should be written.
My script with 2 loops works, but is to slow for millions of rows. I'm trying this now with awk, but I don't know how to compare 2 files with it.
File 1
dn:abc|attribut a: 10|attribut b: 11|attribut c: 12
dn:xyz|attribut a: 10|attribut b: 11|attribut c: 12
File 2
dn:abc|attribut a: 10|attribut b: 11|attribut c: 12
dn:xyz|attribut a: 10|attribut c: 11
Needed Output
dn:xyz|add attribute b: 11|replace attribute c: 12
Line with dn:abc is identical in both file, so it's not written in output file.
Line dn:xyz has difference, so I need this first field contain "dn:xyz". Next field attribut a: 10 is identical so nothing do. Next field is missing in file 2, I need "add attribut b: 11". Last field attribut c: is in both files but the value differs in file 2, I need "replace attribut c: 12" the value from file 1.
This is not a direct answer to the question, however, from the comments it seems that the files to be compared are being created from standard LDIF formatted files.
There already exist tools to take two LDIF files and output the changes needed to reconcile them. For example:
OpenDJ provides ldifdiff in its opendj-ldap-toolkit package
ldifdiff is a Go tool
ldiff is an unmaintained Perl script to "generate differences between two LDIF files"
ldap-diff - another Perl script
One of these tools is likely to be much more reliable than something new from scratch.
Some background reading on LDIF, including change records:
rfc2849
notes from Oracle
When my logging system outputs the source and line number in the proper format (name.java:linenumber), it appears in the output console like a link you can click on, taking you to the corresponding line number of that source code, which works great. Except my logging system prints like a stack trace, a series of source location on a single line, like this:
date/time - a logging statement - (Source1.java:123) (Source2.java:321) (Source5.java:11)
The thing is that IntelliJ only makes the first one a link. The remaining ones don't become clickable links.
Is there a way to configure IntelliJ to scan all source location for each line in the console output, and not just the first one for each line?
This feature is not available at the moment and the progress can be tracked at:
Highlight links with multiple (source.java:line) per line in the output console
I want to find all the merge arrows pointing to a certain version in a script. When I describe the version of the element with the following command:
ct describe filename##/main/some_branch/3
I get in the result the following:
Hyperlinks:
Merge <- filename##/main/other_branch/2
I want ct describe to output only the relevant information to be used in my script, ie. the versions where the merge arrows come from. In my case, the output should look simply like this:
filename##/main/other_branch/2
I didn't find any relevant parameters in the -fmt from the man page. Is there any way of doing it?
The only option in the fmt_ccase man page would be
%[hlink:filter]p
Displays the hyperlink source and target, with an arrow pointing from the source to the target. The optional H argument lists only the hyperlink names.
You can optionally specify a filter string, preceded by a colon. This filter if present, restricts the output to names that match the filter string. Case is considered when matching the string.
If this doesn't work, you have to resort to grep/awk commands in order to extract those version from the cleartool describe output.
The cleartool descr -ahlink restricts a bit the output.
–ahlink
The listing includes the path names of the objects hyperlinked to pname, annotated with → (listed object is the to- object) or ← (listed object is the from-object).
For example:
-> M:\gamma\vob1\proj\include\db.c##\main\52 <- M:\gamma\vob1\proj\bin\vega##\main\5
Beside the full script option, you can have a look at external third-party tools like R&D Reporter, which can vizualize and export those same hyperlinks.
However:
this is a commercial tool
depending on the export output and what you want, you might end up parsing just another output to extract what you need.
For more on that tool, contact Tamir Gefen.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for a free tool that allows re-arranging pages of a PDF document and combining multiple pages per sheet. The first part (re-arranging) is easily solved by many tools (I use PyPDF).
The problem is with the second requirement: to combine two (or more) pages into single page. For example, take two pages (A and B), rotate them, scale and combine into a single page like this
------ ------ ------
| | | | | |
| A | | B | | a |
| | | | | |
| | | | ---> ------
| | | | | |
| | | | | b |
| | | | | |
------ ------ ------
The solution needs to work on Linux and preferably on Windows too. I'm looking for either console application or library with Python or Perl bindings.
Edit there is pdfnup library that is supposed to perform exactly this kind of transformation, and is cross-platform, however I cannot use it due to a bug similar to this.
This is a summary of the tools I found for PDF (I wanted to find the equivalent of psup and psbook)
Create booklets: pdfbook, pdf-tools (command: pdfbklt)
Merge PDF files: pdfmerge, pdfjam (command: pdfjoin)
Rotate pages: pdfjam (command: pdf90)
Multiple pages per sheet: pdfjam (command: pdfnup)
Create posters (multiple sheets per page): pdfposter
From my package manager:
pdf-tools: http://search.cpan.org/dist/Text-PDF
pdfbook: http://www.ctan.org/tex-archive/support/pdfbook/
pdfmerge: https://github.com/dmaphy/pdfmerge
pdfjam: http://go.warwick.ac.uk/pdfjam
pdfposter: http://pdfposter.origo.ethz.ch/
Create an A6 booklet:
pdfbook -2 -p a5 infile.pdf outfile.pdf
pdf-tools contains:
pdfbklt: create booklets
pdfrevert: Removes one layer of changes to a PDF file, trying to maximise the size of the output file (to account for linearised PDF).
pdfstamp: Adds the given string to the infile .pdf file at the given location, font and size.
There is also multivalent: http://multivalent.sourceforge.net/Tools/index.html
On Linux, you can convert the PDF files to Postscript and use psnup. The exact way to invoke it depends on exactly how you want the pages to be put together, whether you want them rotated, what paper size(s) you want to use, etc. but it'll be something like this:
pdf2ps infile.pdf infile.ps
psnup -2 infile.ps outfile.ps
ps2pdf outfile.ps outfile.pdf
Depending on what tools you have available, you might have a more efficient way to do this - psnup is certainly not the only way, but it's a relatively well-known program (on Linux anyway).
If you use Linux, you can use BookletImposer for putting multiple PDF pages on one single page.
For Ubuntu users, this tool is available at Ubuntu Software Center.
Check out this answer that uses Multivalent to impose PDF pages
In answer to your question, you'll need a PDF 'Imposition' tool, which is a fancy way of saying a tool that arranges PDF page images onto a particular array to create a NEW single PDF page. Imagine it's something like typesetting a newspaper. You define an array of slots a certain number of columns wide, by a certain number of rows deep, on a page of a certain fixed dimensions (in cm). Then you fill those empty slots top to bottom, left to right with pages from a pdf source-file. In the case of the OP, they want to create a single page, composed of two 8.5x11 pages arranged in a 1x2 array (1 column, 2 rows). Their pages will be dropped into the array in the following order: 1,2. So you are dropping the first page (page 1 of the pdf) into the first slot of your array (Column 1, row 1), and you are dropping the second page (page 2) into the second slot (Column 1, row 2).
How to use the tool to make this happen:
Download the old version of Multivalent. Note the author removed the good tool classes from the latest edition without explanation, so you have to use an older one. Here's a working link as of 02/12:
http://code.google.com/p/pdfsizeopt/downloads/detail?name=Multivalent20060102.jar
For simplicity, I renamed the jar file to m.jar.
It sort of goes without saying that you need to install JRE for this to work, but I'll put it out there.
Add m.jar to your Java Class Path Environment variables (for scripting) or run the command line syntax with the -cp option and the relative path (shown below). Note, I ran it FROM the command-line at the install directory in my example below. Provide an absolute path from root otherwise (like c:\1\bin\m.jar).
Here is an example that will accomplish exactly what OP posted about:
C:\1\bin>java -cp m.jar tool.pdf.Impose -dim 1x2 -verbose -papersize "21.59x55.88cm" -layout "1,2" yourfilename.pdf
Note, the -dim option creates the array in Columns x Rows. The -papersize is specified in centimeters here, but if you need inches, just multiply inches by 2.54 to get cm. The -layout option gives you the order you want to fill the empty slots in your array, filling from top to bottom and left to right. In this case, we want page one of the pdf on top and page two on the bottom, so our argument is "1,2". The final argument is your actual source file. The tool will output a file called yourfilename-up.pdf when you are done.
Hope that helps.
-Matt Zweil
Check the source code of PyPDF, especially the rotateClockwise() method. There must be a place where the content of a page is written. Insert a "q" operator (save state) and "cm" (with the correct parameters for a scaling matrix) before the content and a "Q" operator (restore state) afterwards.
See the PDF documentation for an explanation of operators and the structure of a page (scroll to the bottom for some useful links).
Don't forget to send a patch to PyPDF :)
[EDIT] You might also want to check the pdfjam sources which include a pdfnup command.
This is a perl function I use to grab a directory full of prn files from a 3rd party app and create a single merged pdf.
sub runMerged($)
{
my($path) = #_;
print "Generating merged PDFs for $path\n";
my #files = sort(getFiles($path, ".prn\$"));
if (scalar(#files))
{
open(MERGE, ">$path/merged.prn");
for (my $i = 0; $i < scalar(#files); $i++)
{
print MERGE "^L\n" if ($i > 0);
open(FN, "$path/" . $files[$i]);
while (my $line = <FN>)
{
print MERGE $line;
}
close(FN);
}
chdir("$BASE_PATH/txt2pdf");
print `./txt2pdf.pl $path/merged.prn`;
}
}
I Had a similar need this week.
But I needed to repeat each A4 page (landscape) "twice" in the A3 sheet (portrait), to later cut then in half.
I found a Acrobat Plugin with tons of imposition features that worked great for my needs, and with a fully functional 30 days trial.
Hope It could be helpfull for someone else.
http://www.pdfsnake.com/
I had the same issue as you and this is what I did:
Extracted all the pages in the pdf file as a separate file each
In irfanView (with plugins) I created a Vertical "Panoramic" image
Dragged the pdf files over to the images section
Clicked created
The "image" is created with all the pages following each other as one very long vertical image
You can export to PDF with almost no loss in quality.
Enjoy
Here's a script for repeating pages (like A5, landscape) twice on a sheet double this size (A4, portrait):
#!/bin/bash
INPUTFILE=$*
PAGENUM=`pdftk ${INPUTFILE} dump_data | grep NumberOfPages | cut -d : -f 2 | cut -d " " -f 2`
PAGES=`seq 1 ${PAGENUM}`
DUPAGES=`for i in ${PAGES} ; do echo $i $i | tr "\n" " " ; done`
OUTPUT1=`basename ${INPUTFILE} .pdf`.dup.pdf
OUTPUT2=`basename ${INPUTFILE} .pdf`.double.pdf
pdftk ${INPUTFILE} cat ${DUPAGES} output ${OUTPUT1}
pdfjam --nup 1x2 ${OUTPUT1} --outfile ${OUTPUT2}
It's not really elegant; it could be done without the second pdftk call, and it does not work with files containing spaces. But it works with multi-page pdfs.
Using Adobe Acrobat XI Pro, open the 1st document.
Edit, select "take a snapshot", then click at the top corner of what you want to copy and drag to the opposite corner.
Have an open clean sheet in Paint.
Click over to the clean sheet in paint and control V to paste the 1st document into the clean sheet.
Repeat for the 2nd item that you want to combine on the same page except position the 2nd item UNDER the 1st item temporarily in your Paint sheet.
Then drag the 2nd item to position it where you need it in the Paint Sheet.
Save the paint sheet file and you are done!