PDFへのOpenOffice Excelファイルのエクスポートはプログラムで行われています.PDFドキュメントでセルの背景を透明にする変換プロセス中に何らかのフラグまたは何かを渡すことで、この問題を解決する方法があるかどうかを知りたい.
PDF 出力の例に注意してください。元の Excel ファイルでは、エッジがまったく重なっていません: http://www.freeimagehosting.net/uploads/4ab8dd9af0.jpg
これは PDF エクスポート前の元の Excel ファイルです: http://www.freeimagehosting.net/uploads/0cdcaad47a.jpg
OpenOffice 2.4 と 3.0 の両方に、これと同じ欠陥があります。
提案は大歓迎です。これは、このプロジェクトを遅らせる最後のものです。
OpenOffice Web サイトの例については、次のリンクに従ってください: http://user.services.openoffice.org/en/forum/viewtopic.php?f=20&t=13528
問題トラッカーのリンクは次のとおりです: http://www.openoffice.org/issues/show_bug.cgi?id=97856
いくつかのコードは、Java 2.5 を使用したJython 2.2.1 です。
def _save_as_pdf(self, docSource):
dirName=os.path.dirname(docSource)
baseName=os.path.basename(docSource)
baseName, ext=os.path.splitext(baseName)
dirTmpPdfConverted=os.path.join(dirName + DIR + PDF_TEMP_CONVERT_DIR)
if not os.path.exists(dirTmpPdfConverted):
os.makedirs(dirTmpPdfConverted)
pdfDest=os.path.join(dirTmpPdfConverted + DIR + baseName + ".pdf")
url_save=self._create_UNO_File_URL(pdfDest)
properties=self._create_properties(ext)
try:
try:
self._xstorable=UnoRuntime.queryInterface(XStorable, self._doc)
self._xstorable.storeToURL(url_save, properties)
except AttributeError,e:
self.logger.info("saving as pdf has problem: (" + str(e) + ")")
raise e
except:
self.logger.info("storeToURL exception")
raise
finally:
self.logger.info("converted document " + baseName + ext)
if not self._doc:
xCloseable = UnoRuntime.queryInterface(XCloseable, self._doc)
if not xCloseable:
try:
xCloseable.close(false)
except CloseVetoException, (ex):
xComp = UnoRuntime.queryInterface(XComponent, self._doc)
xComp.dispose()
else:
xComp = UnoRuntime.queryInterface(XComponent, self._doc)
xComp.dispose()
self._doc=None
def _create_properties(self,ext):
properties=[]
p=PropertyValue()
p.Name="Overwrite"
p.Value=True
properties.append(p)
p=PropertyValue()
p.Name="FilterName"
if ext==".doc":
p.Value='writer_pdf_Export'
elif ext==".rtf":
p.Value='writer_pdf_Export'
elif ext==".html":
p.Value='writer_pdf_Export'
elif ext==".htm":
p.Value='writer_pdf_Export'
elif ext==".xls":
p.Value='calc_pdf_Export'
elif ext==".tif":
p.Value='draw_pdf_Export'
elif ext==".tiff":
p.Value='draw_pdf_Export'
properties.append(p)
return tuple(properties)