pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Herrmann <wjherrm...@gmail.com>
Subject Re: Printing PDF only shows a few letters in 1.8.7+, works in 1.8.6
Date Wed, 03 Dec 2014 04:35:08 GMT
I'm glad that you included the Java version; I realized that I was running JDK 1.7.0_25. When
I switched to Java 1.7.0_51, it worked just fine with the latest 1.8.8 snapshot on OS X, both
when using "Open PDF in Preview" and truly printing.

So it seems like PDFBox 1.8.7+ has issues with printing when using older versions of Java
1.7. Using newer versions should fix it.

Thanks for all your help!

-Will Herrmann

On Dec 2, 2014, at 2:56 AM, Maruan Sahyoun <sahyoun@fileaffairs.de> wrote:

> Hi,
> I tested using pdfbox-app-1.8.7 on OS X and the file renders fine 
> - printing to a real printer
> - opening in preview using the PDF drop down in the printer dialog 
> - using PDFToImage.
> Java Version I'm using is 1.7.0_55-b13
> BR
> Maruan
> Am 02.12.2014 um 04:51 schrieb Will Herrmann <wjherrmann@gmail.com>:
>> Thanks for your persistence in looking at this. It looks like I got my PDFs mixed
up earlier and this issue with PDFs not printing properly only seems to happen on OS X, where
I can consistently reproduce it, but not on Windows 8. In both cases, I am using Java 7.
>> If there is any more information I can provide or testing I can try, let me know.
>> -Will Herrmann 
>>> On Dec 1, 2014, at 1:53 PM, Tilman Hausherr <THausherr@t-online.de> wrote:
>>> Hi,
>>> I've just tried your code, even with the scratch file, and I was able to print
without any trouble. Both on a real printer and on CIB PDF (on windows).
>>> Tilman
>>>> Am 01.12.2014 um 20:13 schrieb Will Herrmann:
>>>> Using the commands that you provided me in the command line worked just fine
and the text appeared without incident.
>>>> I tried changing my code to not using a scratch file, like you suggested,
but I got the same results as when I did have a scratch file.
>>>> (If it matters, I'm not actually printing these, but rather just going to
the final print dialog and choosing "Open in Preview" on OS X and using CutePDF on Windows
to create a PDF of exactly what is being sent to the printer).
>>>> -Will Herrmann
>>>>> On Dec 1, 2014, at 1:11 AM, Tilman Hausherr <THausherr@t-online.de>
>>>>> Hi,
>>>>> Could you try doing the same from the command line, and what happens?
>>>>> java -jar pdfbox-app-1.8.7.jar PrintPDF "PDF That Prints in PDFBox 1-8-6.pdf"
>>>>> java -jar pdfbox-app-1.8.7.jar PDFReader "PDF That Prints in PDFBox 1-8-6.pdf"
>>>>> because I did this and all the glyphs are there... So only difference
is that I didn't test with a scratch file like you did.
>>>>> Tilman
>>>>>> Am 01.12.2014 um 05:53 schrieb Will Herrmann:
>>>>>> I have a PDF (downloadable at http://bit.ly/1w96YVz) that prints
fine in PDFBox 1.8.6 (using the pdfbox-app distribution, if it matters). The text is properly
spaced and prints without issue, matching how it appears in Adobe Reader and OS X Preview.
>>>>>> But in both PDFBox 1.8.7 and the latest 1.8.8 snapshot, PDFBox only
prints the letters "F u c r", with a great deal of spacing in between. Oddly, theses are the
1st, 3rd, 5th, and 7th letters of the text in the PDF. Nothing else appears on any other line.
>>>>>> The code that I am using with both versions of the library is as
>>>>>> ------------
>>>>>> String fileLocation = //File Location
>>>>>> File scratchFile = new File(System.getProperty("java.io.tmpdir"),
>>>>>> if (!scratchFile.exists())
>>>>>>  scratchFile.createNewFile();
>>>>>> scratchFile.deleteOnExit();
>>>>>> PDDocument doc = PDDocument.load(fileLocation, new RandomAccessFile(scratchFile,
>>>>>> doc.print();
>>>>>> ------------
>>>>>> I tried searching the issue tracker to see if this is a known issue,
but I wasn't entirely sure what sort of words to search for. I'd appreciate it if community
could tell me if this is a known issue or, if not, whether or not a bug report might be created
for the behavior.
>>>>>> Thanks in Advance,
>>>>>> -Will Herrmann

View raw message