Ask Your Question
0

prevent loading of external resources (converting to pdf) [closed]

asked 2013-09-16 00:01:15 +0200

user24556 gravatar image

updated 2015-08-28 19:13:44 +0200

Alex Kemp gravatar image

I want to turn off the loading of external resources (images) during the conversion.

For example, if a .html or .doc(x) file looks like this:

<html>
...
<img src="https://www.somewebsitewithaimage/myniceimage1234.png">
...
</html>

and i convert:

with batch

soffice.exe -headless -nologo -invisible -convert-to pdf "C: \ my.html" - outdir "C: \"

or with C # (. net)

public bool Save (string filename, string filter)
         {
             List <PropertyValue> pv = new List <PropertyValue> ();
             pv.Add (new PropertyValue ("Filter Name", 0, new uno.Any (filter), PropertyState.DIRECT_VALUE));
             pv.Add (new PropertyValue ("Overwrite", 0, new uno.Any (true), PropertyState.DIRECT_VALUE));
             try
             {
                 filename = filename.Replace ("\ \", "/");
                 ((XStorable) doc) storeToURL ("file :/ / /" + filename, pv.ToArray ());
                 return true;
             }
             catch {return false;}
         }

then the images are captured from the external source (http) and stored in the pdf. How can I prevent the loading of external content?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-08 21:08:29.211568

1 Answer

Sort by » oldest newest most voted
0

answered 2013-09-16 00:36:06 +0200

m.a.riosv gravatar image

Try making a first export from Menu/File/Exporta PDF and see if link options lets do it so. I think it is saved for the next times.

edit flag offensive delete link more

Comments

I have to convert my file programmatically (without a GUI)

user24556 gravatar imageuser24556 ( 2013-09-16 00:54:44 +0200 )edit

Right, but I think some parameters setting up in GUI are used in the console mode.

m.a.riosv gravatar imagem.a.riosv ( 2013-09-16 10:07:01 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2013-09-16 00:01:15 +0200

Seen: 219 times

Last updated: Sep 16 '13