| View previous topic :: View next topic |
| Author |
Message |
ben1t Newbie

Joined: 03 Aug 2004 Posts: 2
|
Posted: Tue Aug 03, 2004 9:28 am Post subject: OO in server mode on Linux generates long, narrow PDFs |
|
|
Greetings,
We're using Open Office(1.1.2) to do HTML->PDF conversion on some Linux machines.
We're running OO in -headless mode (with Xvbf) and connecting to OO over a socket. Our conversion uses the writer_web_pdf_Export filter.
Everything works fine except that the PDFs which are generated are super-skinny - they're as wide as the longest word. It looks like the document width is 0 (though the margins appear to be obeyed; there is white space on all sides of the text).
I've tried messing with every parameter I can think of by using spadmin to change margins, paper sizes, etc - but with no success.
Has anyone seen this problem, or does someone have a suggestion for something that I might be doing wrong? I'm running out of ideas...
Thanks for any help!
Ben |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Tue Aug 03, 2004 12:49 pm Post subject: |
|
|
The writer web pdf export is probably the reason.
Are your documents Web or Writer?
Maybe you can open your document (even if HTML) into Writer instead of Web. Then use Writer's PDF export which will have individual pages, as Writer does. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
ben1t Newbie

Joined: 03 Aug 2004 Posts: 2
|
Posted: Tue Aug 03, 2004 2:31 pm Post subject: |
|
|
Thanks for the reply, Danny!
The incoming documents are HTML. I'll try opening the document into Writer and then exporting into PDF. We'd thought that writer web pdf export actually did go through Writer first (because of "writer" in the name)...
There must be someone else out there using OO to do HTML->PDF conversion...
Why do you think the writer web pdf export is the culprit?
Thanks again for the feedback,
Ben |
|
| Back to top |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Wed Aug 04, 2004 10:10 am Post subject: |
|
|
Have you tried the extendedPDF macro?
Might have problems because of the web stuff, but one never knows... _________________ --
Andrew Pitonyak
http://www.pitonyak.org/oo.php |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Aug 06, 2004 7:07 am Post subject: |
|
|
See this...
http://www.oooforum.org/forum/viewtopic.php?t=3973
WEB has a limited set of export options. One of them is PDF. The WEB->PDF export filter generates a long skinny PDF. (Like a web page viewed in a browser!)
You don't want a long skinny PDF.
Ergo, you don't want the WEB->PDF export filter.
Therefore, you must need a different PDF export filter.
WRITER has a WRITER->PDF export filter that generates one PDF page for each writer page.
Writer can import HTML documents, but an import filter is required to load HTML into WRITER.
Since WRITER can import html, and can export pdf in the format you want, the problem seems trivially solved.
WRITER and WEB are not the same thing.
| Code: | Sub Main
' CHANGE ME!!!!
' Put your own HTML document here....
cFile = "C:\Documents and Settings\dbrewer\Desktop\search.php.htm"
' Convert filename to URL.
cUrl = ConvertToURL( cFile )
' Load the HTML file, but load it into WRITER not into WEB!
' We MUST specify an import filter to force the file to load in WRITER.
oDoc = StarDesktop.loadComponentFromURL( cUrl, "_blank", 0,_
Array(_
MakePropertyValue( "FilterName", "HTML (StarWriter)" ) ) )
' Save as PDF.
' Note that we must use the WRITER export filter,
' because this is a WRITER document not a WEB document.
cFile = "C:\Documents and Settings\dbrewer\Desktop\search.pdf"
cUrl = ConvertToURL( cFile )
oDoc.storeToURL( cUrl,_
Array(_
MakePropertyValue( "FilterName", "writer_pdf_Export" ) ) )
' Close the window
oDoc.close( True )
End Sub
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
|
In the line that says....
| Code: | oDoc = StarDesktop.loadComponentFromURL( cUrl, "_blank", 0,_
Array(_
MakePropertyValue( "FilterName", "HTML (StarWriter)" ) ) )
|
If you don't want a window to briefly pop up on screen, then add a Hidden=True property like this....
| Code: | oDoc = StarDesktop.loadComponentFromURL( cUrl, "_blank", 0,_
Array(_
MakePropertyValue( "FilterName", "HTML (StarWriter)" ),_
MakePropertyValue( "Hidden", True ) ) )
|
If you do this, THEN BE SURE to close the document! Otherwise, you end up with an insivible document left open in the office. Because it is invisible, the user is unable to close it. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|