ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Exported figures
@ 2011-08-26  6:16 Aditya Mahajan
  2011-08-27  9:16 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2011-08-26  6:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans,

Two bugs in figure export:

1. If one uses images without extension, then the generated 
\jobname-images.css file does not contain any extensions; so no figures 
are shown in the output. One possible fix is to change \dotagfigure in 
back-ini.mkiv to

\appendtoks % we can have differently scaled images

\def\dotagfigure{\taggedctxcommand{settagfigure(,"\figurefullname","\figurefilepage",\number\dimexpr\figurewidth,\number\dimexpr\figureheight)}}%
\to \everyenableelements
% \figurefullname instead of \figurefileoriginal


2. What is the best way to handle multipage pdf images? I frequently 
create a big pdf with many images and then use

\externalfigure[...][page=2]

I don't know if svg has support for multiple pages or not.

Aditya~
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Exported figures
  2011-08-26  6:16 Exported figures Aditya Mahajan
@ 2011-08-27  9:16 ` Hans Hagen
  2011-08-28  3:41   ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2011-08-27  9:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 26-8-2011 08:16, Aditya Mahajan wrote:
> Hi Hans,
>
> Two bugs in figure export:
>
> 1. If one uses images without extension, then the generated
> \jobname-images.css file does not contain any extensions; so no figures
> are shown in the output. One possible fix is to change \dotagfigure in
> back-ini.mkiv to
>
> \appendtoks % we can have differently scaled images
>
> \def\dotagfigure{\taggedctxcommand{settagfigure(,"\figurefullname","\figurefilepage",\number\dimexpr\figurewidth,\number\dimexpr\figureheight)}}%
>
> \to \everyenableelements
> % \figurefullname instead of \figurefileoriginal

tricky ... \figurefullname can be the converted image (say that we wa 
ask for an svg .. .it gets converted to pdf then) .. needs a bit of 
thinking

> 2. What is the best way to handle multipage pdf images? I frequently
> create a big pdf with many images and then use
>
> \externalfigure[...][page=2]
>
> I don't know if svg has support for multiple pages or not.

The 'converter' program can filter the pages ... so we need to pass the 
page number.

So we have 2 todo's

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Exported figures
  2011-08-27  9:16 ` Hans Hagen
@ 2011-08-28  3:41   ` Aditya Mahajan
  2011-09-05 10:53     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2011-08-28  3:41 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Sat, 27 Aug 2011, Hans Hagen wrote:

> On 26-8-2011 08:16, Aditya Mahajan wrote:
>> 2. What is the best way to handle multipage pdf images? I frequently
>> create a big pdf with many images and then use
>> 
>> \externalfigure[...][page=2]
>> 
>> I don't know if svg has support for multiple pages or not.
>
> The 'converter' program can filter the pages ... so we need to pass the page 
> number.

Page number is already passed. The filename conversion should make 
use of it.

I think that the best solution is to allow the user to configure (using a 
directive) the function that sets the new name for a pdf file, rather than 
hardcoding an extension.


Also, can you add background-repeat: no-repeat; to imagetemplate.

local imagetemplate = [[
%s[id="%s"] {
     display          : block ;
     background-image : url(%s) ;
     background-size  : 100%% auto ;
     background-repeat:no-repeat;
     width            : %s ;
     height           : %s ;
}]]

Normally, this should not matter, but sometimes part of the image is 
repeated due to rounding differences.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Exported figures
  2011-08-28  3:41   ` Aditya Mahajan
@ 2011-09-05 10:53     ` Hans Hagen
  2011-09-05 16:23       ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2011-09-05 10:53 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users

On 28-8-2011 05:41, Aditya Mahajan wrote:

> Also, can you add background-repeat: no-repeat; to imagetemplate.
>
> local imagetemplate = [[
> %s[id="%s"] {
> display : block ;
> background-image : url(%s) ;
> background-size : 100%% auto ;
> background-repeat:no-repeat;
> width : %s ;
> height : %s ;
> }]]

ok

> Normally, this should not matter, but sometimes part of the image is
> repeated due to rounding differences.

what magic flag deals with a specific page in pdf in inkscape?

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Exported figures
  2011-09-05 10:53     ` Hans Hagen
@ 2011-09-05 16:23       ` Aditya Mahajan
  0 siblings, 0 replies; 5+ messages in thread
From: Aditya Mahajan @ 2011-09-05 16:23 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

>> Normally, this should not matter, but sometimes part of the image is
>> repeated due to rounding differences.
>
> what magic flag deals with a specific page in pdf in inkscape?

I used svg2pdf which converts all pages of a pdf to split svg files. But, 
in the end, decided not to use svg images because most browsers do no 
support svg inserted through css background-image. Instead, I am not 
simply using png images and using imagemagics convert to convert pdf to 
png.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-05 16:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-26  6:16 Exported figures Aditya Mahajan
2011-08-27  9:16 ` Hans Hagen
2011-08-28  3:41   ` Aditya Mahajan
2011-09-05 10:53     ` Hans Hagen
2011-09-05 16:23       ` Aditya Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).