| View previous topic :: View next topic |
| Author |
Message |
ibvhefe General User

Joined: 19 Jul 2007 Posts: 27
|
Posted: Thu Jul 03, 2008 5:00 am Post subject: Deleting images from the DocumentStorage |
|
|
Hi folks!
Yet another problem with Basic ;-(
I once added an image to the DocumentStorage using BitmapTable:
| Code: | cFile = "C:\randomPic.png"
cInternalName = "LogoXYZ"
cUrl = ConvertToUrl( cFile )
oBitmaps = thisComponent.createInstance( "com.sun.star.drawing.BitmapTable" )
oBitmaps.insertByName( cInternalName, cUrl ) |
And now I want to delete it again.
But unfortunatelly I found following Comment in the API:
| Code: | [b]BitmapTable[/b]
Description
this container lets you access the URLs that are indexed with a name.
Note: You can add new entries for later use, [b]but you cannot remove entries[/b] that are used inside the document. |
Does anyone know a work-around? ;-(
I would love you! |
|
| Back to top |
|
 |
Fernand OOo Enthusiast

Joined: 22 Jun 2004 Posts: 142
|
Posted: Thu Jul 03, 2008 6:14 am Post subject: |
|
|
| delete de graphic in the document itself ? |
|
| Back to top |
|
 |
ibvhefe General User

Joined: 19 Jul 2007 Posts: 27
|
Posted: Thu Jul 03, 2008 7:03 am Post subject: |
|
|
okay, let me try to explain it, another way:
lets say I have a document called
test.odt
if I rename it into
test.zip
and open the picture folder inside of it
there are too many JPGs and PNGs that are not used anywhere.
How to get rid of them? |
|
| Back to top |
|
 |
ibvhefe General User

Joined: 19 Jul 2007 Posts: 27
|
Posted: Thu Jul 03, 2008 7:26 am Post subject: |
|
|
okay, I found the answer myself.
If you want to delete pictures from the DocumentStorage, do the following:
1. test.odt ---> test.zip
2. open test.zip
3. go to /pictures/
4. choose the picture you dont like (e.g. 10000201000000D1000000193E771149.png)
5. go to /Meta-Inf/manifest.xml
6. open the file with an editor
7. look out for the line, which contains 10000201000000D1000000193E771149.png
8. delete the line
9. test.zip ---> test.odt
you are done  |
|
| Back to top |
|
 |
Fernand OOo Enthusiast

Joined: 22 Jun 2004 Posts: 142
|
Posted: Thu Jul 03, 2008 11:10 pm Post subject: |
|
|
We are here in the macro and API section no ? so there is a way to do this rhings using thze API.
When the graphics are no longer used then the are no longer in the xml file either ? or is there a way to corrupt a file in that sence ?
Fernand |
|
| Back to top |
|
 |
ibvhefe General User

Joined: 19 Jul 2007 Posts: 27
|
Posted: Fri Jul 04, 2008 2:03 pm Post subject: |
|
|
yeah, there is.
Have a look at the codesnipplet in my first post.
It's a one way ticket to your document  |
|
| Back to top |
|
 |
|