[Solved] PDFs missing graphics

The Application Programming Interface and the OASIS Open Document Format

[Solved] PDFs missing graphics

Postby Tim Grantham » Mon Jul 25, 2011 8:57 pm

All of a sudden, the PDFs that my Java UNO API app exports from OO Writer documents no longer contain graphics -- just empty boxes. In some of them, links no longer work, either.

If I manually export to PDF from these documents, the PDFs contain the graphics, exactly as they did before, and all the links work.

I have not changed the code in my Java app at all. In fact, as far as I can tell, nothing has changed anywhere, except that all the graphics have vanished from the PDFs generated by my Java app.

Can anybody help?

Thanks,
Tim.
P.S. I'm using the OO SDK 3.2.1 and OO 3.3.
Last edited by Tim Grantham on Tue Jul 26, 2011 7:42 pm, edited 2 times in total.
OpenOffice 4.1
Windows 7 Professional
Tim Grantham
 
Posts: 31
Joined: Thu Jan 06, 2011 12:03 am

Re: PDFs missing graphics

Postby RoryOF » Tue Jul 26, 2011 8:19 am

Are there many graphics in your file and have you recently added more? Have you sufficient RAM/HD space?
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: PDFs missing graphics

Postby Tim Grantham » Tue Jul 26, 2011 5:14 pm

Ok, I have more information.

My code hasn't changed, but the way graphics are included in the documents has: they are now linked, rather than embedded. When the graphics are embedded, they appear in the exported PDF; when they are linked, they don't appear.

I've tried using the XLinkUpdate interface on the document to update the links before exporting to PDF. Didn't work. I've tried setting the UpdateDocMode parameter on both the loadComponentFromURL and storeToURL methods to FULL_UPDATE. Doesn't work. I've looked to see if there is a PDF Export filter setting that forces inclusion of linked graphics. Couldn't find anything.

What am I missing?

Tim.
OpenOffice 4.1
Windows 7 Professional
Tim Grantham
 
Posts: 31
Joined: Thu Jan 06, 2011 12:03 am

Re: PDFs missing graphics

Postby RoryOF » Tue Jul 26, 2011 5:18 pm

If you make the PDF to the same directory as the ODT file containing the links, do the graphics then show up? Often the PDF is made to a different directory, in which case the link paths might fail.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: PDFs missing graphics

Postby Tim Grantham » Tue Jul 26, 2011 7:41 pm

I got the PDF export to work with linked graphics. Instead of exporting the PDF immediately after processing my source file, I changed my app to first save the processed source file, then re-load it, and only then perform the PDF export. It appears OO Writer changed the way I was organizing the referenced graphics in the archive of the source document when it saved the document, and it looks like the PDF Export filter only works with the archive organized in this manner.

Thanks for the help.

Tim.
OpenOffice 4.1
Windows 7 Professional
Tim Grantham
 
Posts: 31
Joined: Thu Jan 06, 2011 12:03 am


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 1 guest