[xep-support] Re: Problems configuring XEPWin and adding Fonts

From: Kevin Brown <kevin@renderx.com>
Date: Mon Nov 11 2013 - 11:06:29 PST

You cannot set fonts from .NET like adding parameters to the configuration.

It will always read from XEP.xml BUT you can build XEP.xml dynamically (or
modularly) which we do in our processing systems. So you can do something
like this below, key to this is the line:

<font-group href="../root/custom.fonts.xml"/>

You could write the custom.fonts.xml file in a temp directory of your choice
and then create your formatter.

Kevin Brown
RenderX

<?xml version="1.0" encoding="utf-8"?>

<!-- ======================================================= -->
<!-- RenderX XEP Configuration -->
<!-- ======================================================= -->

<config xmlns="http://www.renderx.com/XEP/config">

  <!-- ======================================================= -->
  <!-- CORE Formatter options -->
  <!-- ======================================================= -->
  <options href="file:///c:/program files
(x86)/renderx/xepwin/xep/xep.options.xml"/>

  <!-- ======================================================= -->
  <!-- Fonts -->
  <!-- ======================================================= -->
  <fonts xmlns="http://www.renderx.com/XEP/config"
    default-family="Helvetica">
    
    <!-- ======================================================= -->
    <!-- Core Fonts -->
    <!-- Original RenderX fonts and Windows Fonts -->
    <!-- DO NOT CHANGE -->
    <!-- ======================================================= -->
    <font-group href="file:/C:/Program Files
(x86)/RenderX/XEPWin/xep/xep.fonts.core.xml" />
    
    <!-- ======================================================= -->
    <!-- Custom fonts -->
    <!-- ======================================================= -->
    <font-group href="../root/custom.fonts.xml"/>
  </fonts>
  
  <!-- ======================================================= -->
  <!-- Language-specific data: hyphenation, line breaking, etc -->
  <!-- ======================================================= -->
  <languages href="file:///c:/program files
(x86)/renderx/xepwin/xep/xep.languages.xml"/>

</config>

-----Original Message-----
From: xep-support-bounces@renderx.com
[mailto:xep-support-bounces@renderx.com] On Behalf Of Alexander Reith
Sent: Monday, November 11, 2013 4:17 AM
To: xep-support@renderx.com
Subject: [xep-support] Problems configuring XEPWin and adding Fonts

Hello

I've got some problems to get XepWin to work...
I want to perform the whole configuration in .NET, but this is not working.
Configuration is always loaded from xep.xml

My Code:

        Logger logger = new Logger();
            Configuration config = new Configuration();
            config.SetParam("VALIDATE", "false");
            config.SetParam("DISCARD_IF_NOT_VALID", "false");
            IFormatter formatter = config.CreateFormatter(logger);
            FileStream sourceStream = null;
            FileStream outputStream = null;

            try
            {
                sourceStream = new FileStream(sourcePath, FileMode.Open);
                outputStream = new FileStream(outputPath, FileMode.Create);
                return formatter.Format(sourceStream,
MakeSystemID(sourcePath), "application/pdf", outputStream);
            }
            finally
            {
                if (sourceStream != null)
                    sourceStream.Close();
                if (outputStream != null)
                    outputStream.Close();
            }

Also I want to set the image base path and add some fonts
programmatically...

Best regards

Ale

!DSPAM:87,5280cad69857138315627!

_______________________________________________
(*) To unsubscribe, please visit
http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service
http://w ww.renderx.com/terms-of-service.html

_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html
Received on Mon Nov 11 11:06:33 2013

This archive was generated by hypermail 2.1.8 : Mon Nov 11 2013 - 11:06:41 PST