Bug 51977 - a created long pdf document is not readable
Summary: a created long pdf document is not readable
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.95
Hardware: PC All
: P2 critical
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 09:37 UTC by abdelsalam.ghazalin
Modified: 2012-04-30 00:11 UTC (History)
0 users



Attachments
A PDF with more than 5 meter length (343.21 KB, application/pdf)
2011-10-06 09:37 UTC, abdelsalam.ghazalin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description abdelsalam.ghazalin 2011-10-06 09:37:26 UTC
Created attachment 27707 [details]
A PDF with more than 5 meter length

I created a pdf file with a length of more than 5 meter. The creating ended successfully but after i opened the file, i saw nothing. It is a white page and if i try to select some content then i saw some very smal things.

are there any limitation to the long of the pdf created with fop?
Comment 1 Pascal Sancho 2011-10-06 13:09:33 UTC
Can you please attach a XSL-FO, there is nothing in PDF that demonstrate any issue.
A reproducible test-case will help.
Comment 2 abdelsalam.ghazalin 2011-10-06 13:18:39 UTC
(In reply to comment #1)
> Can you please attach a XSL-FO, there is nothing in PDF that demonstrate any
> issue.
> A reproducible test-case will help.

i'm creating the pdf file from a svg file by using fop 0.95 (PDFTranscoder) in java. therefore ther is no XSL-FO file.
here is my function:

public void savePDF(Document document, String filename, boolean embedFonts, final File fontsDir) throws Exception, LegendProgramException
{
        if (document == null)
	{
		LegendProgramException svgEx = new LegendProgramException("Exception text.", (short) 62);	
                svgEx.setFilename(filename);
		throw svgEx;
	}
	if (filename.endsWith(".svg"))
	{
		filename = filename.substring(0, filename.length() - 3) + "pdf";
	}

	// Configure the transcoder
	PDFTranscoder trans = new PDFTranscoder();
	trans.addTranscodingHint(PDFTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER, new Float(25.4f / (float) utils.getDpi()));
        
	// embedding the fonts
	if (embedFonts)
	{
		this.embededFonts(trans, fontsDir, filename);
	}

	TranscoderInput input = new TranscoderInput((Document) document);
	OutputStream ostream = new FileOutputStream(filename);
	TranscoderOutput output = new TranscoderOutput(ostream);
	trans.transcode(input, output);

	ostream.flush();
	ostream.close();
}
Comment 3 Luis Bernardo 2012-03-07 16:07:49 UTC
what viewer are you using? I can open the file with evince and see the contents without problem (it does take a bit to load though).
Comment 4 Luis Bernardo 2012-03-07 23:24:59 UTC
this is odd... the PDF appears as a white sheet in Adobe Reader (Mac 10.1.2), but the content is visible in Preview (Mac OS X viewer) and in Evince (Linux)
Comment 5 abdelsalam.ghazalin 2012-03-12 07:56:15 UTC
I solved the problem by down scaling the pdf size to 5080mm.
With the following 2 lines the pdf is scaled down to 5080mm		

trans.addTranscodingHint(PDFTranscoder.KEY_MAX_WIDTH, new Float(14400));	trans.addTranscodingHint(PDFTranscoder.KEY_MAX_HEIGHT, new Float(14400));

The problem is that fop doesn't support the pdf version 1.6.
Comment 6 Glenn Adams 2012-04-01 15:39:27 UTC
resolved invalid due to lack of information (FO input file)
Comment 7 Glenn Adams 2012-04-30 00:11:31 UTC
batch transition resolved+invalid to closed+invalid