I am working on a project using Java that embedding PDF with text file. So far, I developed and tested on development tool Eclipse, the program run perfectly smooth and the result were as expected.
I try to run the program on unix, program was run, directories and files created as expected. I verified the result by transferring the PDF from unix to window by using winSCP, I try “Binary” and “Text” from Transfer Setting selection, it came out two different problems.
First of all, I clicked “Text” from the Transfer Setting selection, winSCP finished transfer. I opened the PDF and an error occurred, “Insufficient data for image”. I checked the embedded text file, it presented perfectly lines by lines.
Then, I chose “Binary” and winSCP transferred to window completely. I opened the PDF, it showed perfectly. However, the sentences in the embedded text file massed together in one line.
Did I set something wrong or using wrong transfer method? Or something I looked over?
Thankyou in dvance
Instead of using winscp
you could go for alternatives like ftp, sftp, setting a nfs share between your windows and unix machine or putting your pdf files inside a tar/zip/tar.gz file to transfer it to windows (in binary mode) to avoid any transfer problem.
Then, I chose “Binary” and winSCP transferred to window completely. I opened the PDF, it showed perfectly. However, the sentences in the embedded text file massed together in one line.
Regarding, this point do you now that the unix EOL symbols are not the same than in windows \n
vs \r\n
? This might explain why you have your text, massed together. You might have to change your java code to produce windows style carriage return
, or use unix2dos/tr
tools.
Last but not least, you could also try to open your pdf directly on Linux to check the result.