Exported pdf drawing has white background/My work-around

Discuss the drawing application
Post Reply
t1d
Posts: 6
Joined: Tue Dec 31, 2013 5:54 am

Exported pdf drawing has white background/My work-around

Post by t1d »

Well, I did my best to do my homework/research to find out how to keep Draw from exporting an unmade/unwanted white background with my drawing. I did not find it. I tried finding an option in the latest release of OO in the pdf export function. I did not see it, there, nor find instructions in the Help file. I tried reopening the pdf file, clicking on the white background, deleting it and saving the file. That did not work for me, either. What did work for me was to use the "select all" feature to capture the image and using the "export selection" option in the export-to-pdf generator.

I am sure there are better/correct techniques to accomplish this. But, this is what finally worked for me. I would be pleased to know the proper way. And, I apologize for not finding it myself. I did about three hours of searching.
Attachments
Work Around.jpg
OpenOffice 4.0.1 on Windows XP/SP3
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Exported pdf drawing has white background/My work-around

Post by keme »

Most exported objects will have a background, at least as large as the smallest rectangle surrounding your graphic. What you need is a transparent background.

AFAIK the PDF format has the option of transparent document background, but Draw does not support that option. Can you use other formats?
I believe exported SVG objects come without the background. GIF and PNG have a background which can be made transparent (use "export selection" like you did for the PDF).
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
t1d
Posts: 6
Joined: Tue Dec 31, 2013 5:54 am

Re: Exported pdf drawing has white background/My work-around

Post by t1d »

keme wrote:What you need is a transparent background.
I attempted to remove the background in several manners:
1) I created the graphic without any background
2) I added a transparent layer as the back-most layer to the Draw working file.
3) I opened the new pdf file in Draw, removed the layer that had been added and saved the file.
All of these methods failed. The one option that I did not think of was to open the pdf file and change the background layer to clear, as opposed to removing it.
keme wrote:AFAIK the PDF format has the option of transparent document background, but Draw does not support that option.
This issue seems to have been observed for many years. It would be nice to have that as an option.
keme wrote:Can you use other formats?
Yes, I could have. But, pdf was recommended for the application.

Thank you for your thoughts!
OpenOffice 4.0.1 on Windows XP/SP3
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Exported pdf drawing has white background/My work-around

Post by acknak »

There are software tools available that work directly on pdf files. It might be possible to change the page background from white to transparent.

That's just a guess but maybe something to look into. OO by itself can't give you a transparent background for pdf output--well, as far as I know, anyway.
AOO4/LO5 • Linux • Fedora 23
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Exported pdf drawing has white background/My work-around

Post by keme »

acknak wrote:There are software tools available that work directly on pdf files. It might be possible to change the page background from white to transparent.

That's just a guess but maybe something to look into. OO by itself can't give you a transparent background for pdf output--well, as far as I know, anyway.
Yes, I see now that I didn't mention that explicitly. It was only in my mind: I know that you can use Adobe Acrobat to edit existing PDF files and change background (or anything else) to transparent. Acrobat is not free in any sense...

ImageMagick is a free command line tool. It can handle most graphics formats out there, and replace colour/transparency on selected parts of images. Depending on what you need to change, and also the graphics layout and the file format, selection of parts can be tricky (intermediate mask creation, defining colour ranges, etc.). Working on graphics in a text environment is not so intuitive, so it may require a bit of practice to get used to it.

Also, when properly installed with all dependencies, ImageMagick can read and write PDF files. I haven't used it for that, but it should be possible to automate background removal on PDF files with ImageMagick. ImageMagick depends on the GhostScript interpreter to work with PDF files. GhostScript is not included in the ImageMagick download, but IIRC the installer will ask for your permission to download and install it if it's not already installed on your system. (The reason for not including it is probably incompatible licensing conditions.)
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
t1d
Posts: 6
Joined: Tue Dec 31, 2013 5:54 am

Re: Exported pdf drawing has white background/My work-around

Post by t1d »

Thanks, guys! Good information!
OpenOffice 4.0.1 on Windows XP/SP3
alg
Posts: 53
Joined: Tue Apr 03, 2012 5:02 pm

Re: Exported pdf drawing has white background/My work-around

Post by alg »

With the newest AOO versions you can export the object (selected) as PNG (do not forget to click the 'selection' marker in the export file dialog), this should give you a transparent background and smooth AntiAliased edges. You could also copy/paste the selected object form AOO to any graphic program, this should also give a transparent background (if supported by the target graphic program). You can also convert the vector object inside AOO to a transparent bitmap object first using the context menu convert/to bitmap.
Unfortunately I have no idea if PDF supports a fully transparent background in any way, sorry. Since it is a page description language (and thus is based on the concept of a 'paper' page in the background) I would doubt that.
OpenOffice 3.3/3.4 on various systems
Xelas
Posts: 1
Joined: Fri Oct 02, 2015 9:40 pm

Re: Exported pdf drawing has white background/My work-around

Post by Xelas »

Holy smokes - I just spent a very frustrating 4 hours trying to convert a multi-layer ODF drawing into a layered PDF. I exported the PDF layer by layer, but each layer came with it's white background, which made the layers pointless for PDFs.

Hiding layers in Draw, hitting "ctrl+A", and exporting "selection" did the trick! Thank you very much! I registered just to say thanks . . . .

It is incredibly annoying that Draw cannot export to PDF with the layers intact.
LibreOffice 5.0.2 on Windows 7 Pro x64
Post Reply