You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Jeffrey Elrod <JF...@clemson.edu> on 2014/04/29 18:06:27 UTC

Blank page when creating document in Linux

Hi everyone,

I'm using PDFBox to create a PDF document for our Registrars Department.  We develop on Windows but deploy our software to run on Linux.  Mostly PL/SQL development, but this development item I'm writing in Java.

On windows, I generate the PDF successfully.  But on Linux the document is blank.  Same number of pages, just all of them are blank.  I tried using another font but to no avail.  For windows I used the static method PDTrueTypeFont.loadTTF.

InputStream fontStream = GenerateLOMReport.class.getResourceAsStream("/org/apache/pdfbox/resources/ttf/ArialMT.ttf");
PDFont font = PDTrueTypeFont.loadTTF(document, fontStream);

For Linux/Unix I use the constructor PDType1AfmPfbFont.

InputStream afmStream = new FileInputStream(new File("/usr/share/fonts/default/Type1/a010013l.afm"));
InputStream pfbStream = new FileInputStream(new File("/usr/share/fonts/default/Type1/a010013l.pfb"));
PDFont font = new PDType1AfmPfbFont(document, afmStream, pfbStream);

I would greatly appreciate any help.

Jeffrey F. Elrod
Senior Applications Analyst
CCIT - Enterprise Applications
Clemson University


Re: Blank page when creating document in Linux

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi,

> Jeffrey Elrod <JF...@clemson.edu> hat am 29. April 2014 um 18:06 geschrieben:
>
>
>
> Hi everyone,
>
> I'm using PDFBox to create a PDF document for our Registrars Department.  We
> develop on Windows but deploy our software to run on Linux.  Mostly PL/SQL
> development, but this development item I'm writing in Java.
>
> On windows, I generate the PDF successfully.  But on Linux the document is
> blank.  Same number of pages, just all of them are blank.  I tried using
> another font but to no avail.  For windows I used the static method
> PDTrueTypeFont.loadTTF.
>
> InputStream fontStream =
> GenerateLOMReport.class.getResourceAsStream("/org/apache/pdfbox/resources/ttf/ArialMT.ttf");
> PDFont font = PDTrueTypeFont.loadTTF(document, fontStream);
>
> For Linux/Unix I use the constructor PDType1AfmPfbFont.
>
> InputStream afmStream = new FileInputStream(new
> File("/usr/share/fonts/default/Type1/a010013l.afm"));
> InputStream pfbStream = new FileInputStream(new
> File("/usr/share/fonts/default/Type1/a010013l.pfb"));
> PDFont font = new PDType1AfmPfbFont(document, afmStream, pfbStream);
>
> I would greatly appreciate any help.
Can you provide us with a sample pdf which was created in your linux
environment, so that we can see what's wrong.
Please be aware that our mailing list doesn't support attachments like pdfs, use
a sharehoster or something similar
instead.

> Jeffrey F. Elrod
> Senior Applications Analyst
> CCIT - Enterprise Applications
> Clemson University


BR
Andreas Lehmkühler

RE: Blank page when creating document in Linux

Posted by Jeffrey Elrod <JF...@clemson.edu>.
Hi Tilman,

You were on the right track ... the PDF document resides on the linux box and when I clicked on it to view it, my secure shell window on my windows desktop FTP'ed it to my desktop in the ASCII format.  When I told it to transfer in a binary format, it showed the text output.

Thanks
Jeff (Extremely embarrassed)

-----Original Message-----
From: Tilman Hausherr [mailto:THausherr@t-online.de] 
Sent: Wednesday, April 30, 2014 3:11 AM
To: users@pdfbox.apache.org
Subject: Re: Blank page when creating document in Linux

Additional thought: how do you display the file? And did you try to display the linux created file on windows?

Tilman

Am 30.04.2014 08:03, schrieb Tilman Hausherr:
> Hi,
>
> Your text is a bit contradictory, "We develop on Windows but deploy 
> our software to run on Linux" means it is the same, but further in the 
> text you tell that you are using a different constructor on LINUX.
>
> Could you try to copy the fonts you are using on LINUX to the Windows 
> version and run it there? What happens?
>
> If it doesn't work, does that happen with any afm / pfb combination?
>
> Have you seen the HelloWorldType1AfmPfb.java code, does this one work 
> on LINUX? If yes, what happens if you modify the
>
> PDFont font = new PDType1AfmPfbFont(doc,fontfile);
>
> line to the lines you mention below?
>
> If it doesn't work, what happens if you use the 2.0 version?
> https://repository.apache.org/content/groups/snapshots/org/apache/pdfb
> ox/pdfbox/2.0.0-SNAPSHOT/
>
>
> Tilman
>
> Am 29.04.2014 18:06, schrieb Jeffrey Elrod:
>>
>> Hi everyone,
>>
>> I'm using PDFBox to create a PDF document for our Registrars 
>> Department.  We develop on Windows but deploy our software to run on 
>> Linux.  Mostly PL/SQL development, but this development item I'm 
>> writing in Java.
>>
>> On windows, I generate the PDF successfully.  But on Linux the 
>> document is blank.  Same number of pages, just all of them are blank.  
>> I tried using another font but to no avail.  For windows I used the 
>> static method PDTrueTypeFont.loadTTF.
>>
>> InputStream fontStream =
>> GenerateLOMReport.class.getResourceAsStream("/org/apache/pdfbox/resou
>> rces/ttf/ArialMT.ttf");
>>
>> PDFont font = PDTrueTypeFont.loadTTF(document, fontStream);
>>
>> For Linux/Unix I use the constructor PDType1AfmPfbFont.
>>
>> InputStream afmStream = new FileInputStream(new 
>> File("/usr/share/fonts/default/Type1/a010013l.afm"));
>>
>> InputStream pfbStream = new FileInputStream(new 
>> File("/usr/share/fonts/default/Type1/a010013l.pfb"));
>>
>> PDFont font = new PDType1AfmPfbFont(document, afmStream, pfbStream);
>>
>> I would greatly appreciate any help.
>>
>> Jeffrey F. Elrod
>>
>> Senior Applications Analyst
>>
>> CCIT -- Enterprise Applications
>>
>> Clemson University
>>
>
>


Re: Blank page when creating document in Linux

Posted by Tilman Hausherr <TH...@t-online.de>.
Additional thought: how do you display the file? And did you try to 
display the linux created file on windows?

Tilman

Am 30.04.2014 08:03, schrieb Tilman Hausherr:
> Hi,
>
> Your text is a bit contradictory, "We develop on Windows but deploy 
> our software to run on Linux" means it is the same, but further in the 
> text you tell that you are using a different constructor on LINUX.
>
> Could you try to copy the fonts you are using on LINUX to the Windows 
> version and run it there? What happens?
>
> If it doesn't work, does that happen with any afm / pfb combination?
>
> Have you seen the HelloWorldType1AfmPfb.java code, does this one work 
> on LINUX? If yes, what happens if you modify the
>
> PDFont font = new PDType1AfmPfbFont(doc,fontfile);
>
> line to the lines you mention below?
>
> If it doesn't work, what happens if you use the 2.0 version?
> https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox/2.0.0-SNAPSHOT/ 
>
>
> Tilman
>
> Am 29.04.2014 18:06, schrieb Jeffrey Elrod:
>>
>> Hi everyone,
>>
>> I'm using PDFBox to create a PDF document for our Registrars 
>> Department.  We develop on Windows but deploy our software to run on 
>> Linux.  Mostly PL/SQL development, but this development item I'm 
>> writing in Java.
>>
>> On windows, I generate the PDF successfully.  But on Linux the 
>> document is blank.  Same number of pages, just all of them are 
>> blank.  I tried using another font but to no avail.  For windows I 
>> used the static method PDTrueTypeFont.loadTTF.
>>
>> InputStream fontStream = 
>> GenerateLOMReport.class.getResourceAsStream("/org/apache/pdfbox/resources/ttf/ArialMT.ttf");
>>
>> PDFont font = PDTrueTypeFont.loadTTF(document, fontStream);
>>
>> For Linux/Unix I use the constructor PDType1AfmPfbFont.
>>
>> InputStream afmStream = new FileInputStream(new 
>> File("/usr/share/fonts/default/Type1/a010013l.afm"));
>>
>> InputStream pfbStream = new FileInputStream(new 
>> File("/usr/share/fonts/default/Type1/a010013l.pfb"));
>>
>> PDFont font = new PDType1AfmPfbFont(document, afmStream, pfbStream);
>>
>> I would greatly appreciate any help.
>>
>> Jeffrey F. Elrod
>>
>> Senior Applications Analyst
>>
>> CCIT -- Enterprise Applications
>>
>> Clemson University
>>
>
>


Re: Blank page when creating document in Linux

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

Your text is a bit contradictory, "We develop on Windows but deploy our 
software to run on Linux" means it is the same, but further in the text 
you tell that you are using a different constructor on LINUX.

Could you try to copy the fonts you are using on LINUX to the Windows 
version and run it there? What happens?

If it doesn't work, does that happen with any afm / pfb combination?

Have you seen the HelloWorldType1AfmPfb.java code, does this one work on 
LINUX? If yes, what happens if you modify the

PDFont font = new PDType1AfmPfbFont(doc,fontfile);

line to the lines you mention below?

If it doesn't work, what happens if you use the 2.0 version?
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox/2.0.0-SNAPSHOT/

Tilman

Am 29.04.2014 18:06, schrieb Jeffrey Elrod:
>
> Hi everyone,
>
> I'm using PDFBox to create a PDF document for our Registrars 
> Department.  We develop on Windows but deploy our software to run on 
> Linux.  Mostly PL/SQL development, but this development item I'm 
> writing in Java.
>
> On windows, I generate the PDF successfully.  But on Linux the 
> document is blank.  Same number of pages, just all of them are blank.  
> I tried using another font but to no avail.  For windows I used the 
> static method PDTrueTypeFont.loadTTF.
>
> InputStream fontStream = 
> GenerateLOMReport.class.getResourceAsStream("/org/apache/pdfbox/resources/ttf/ArialMT.ttf");
>
> PDFont font = PDTrueTypeFont.loadTTF(document, fontStream);
>
> For Linux/Unix I use the constructor PDType1AfmPfbFont.
>
> InputStream afmStream = new FileInputStream(new 
> File("/usr/share/fonts/default/Type1/a010013l.afm"));
>
> InputStream pfbStream = new FileInputStream(new 
> File("/usr/share/fonts/default/Type1/a010013l.pfb"));
>
> PDFont font = new PDType1AfmPfbFont(document, afmStream, pfbStream);
>
> I would greatly appreciate any help.
>
> Jeffrey F. Elrod
>
> Senior Applications Analyst
>
> CCIT -- Enterprise Applications
>
> Clemson University
>