我在Python中使用trml2pdf庫,但即使在使用示例時,我也會得到一個空白PDF文件。 我運行它如下: trml2pdf.py ex5.rml> out.pdfPython - trml2pdf生成一個空白PDF
當我在Acrobat中打開文件時它是空白/空的。 但是,當我分析文本編輯器中的內容時,我看到以下內容。
生成PDF:
%PDF-1.4
%「Œ‹ž ReportLab Generated PDF document http://www.reportlab.com
% 'BasicFonts': class PDFDictionary
1 0 obj
% The standard fonts dictionary
<< /F1 2 0 R
/F2 3 0 R
/F3 4 0 R >>
例PDF:
%PDF-1.3
%「Œ‹ž ReportLab Generated PDF document http://www.reportlab.com
% 'BasicFonts': class PDFDictionary
1 0 obj
% The standard fonts dictionary
<< /F1 2 0 R
/F2 3 0 R
/F3 4 0 R
/F4 5 0 R
/F5 6 0 R >>
我在做什麼錯?爲什麼我在輸出中出現空行?
謝謝!
這裏的基本RML也返回空白的PDF:
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<document filename="example_1.pdf">
<stylesheet>
</stylesheet>
<pageDrawing>
<drawCentredString x="4.1in" y="5.8in">
Hello World.
</drawCentredString>
</pageDrawing>
</document>
也許你應該向我們展示rml文件。你有沒有嘗試過最小的rml? – 2013-02-28 17:32:17
是的,我確實嘗試了最小的rml。我也嘗試了不同的。話雖如此,如果解析器不滿意 - 它會失敗並顯示一條消息(無效標記值)。所以它似乎很高興,它確實會產生一個文件。只是它包含那些奇怪的換行符。 – 2013-02-28 18:02:28
如果您不給我們一些rml最小代碼來查看問題,則很難提供幫助。 – 2013-03-01 08:04:30