Free Support Forum - aspose.com

Aspose.word doesn't print BarCode fonts

hello,

I have a BarCode font. When i create a document in aspose and open the document in Word, it displays (and prints) the barcode.

However when i try to print the document via aspose it doesn't print the BarCode.

Please let me know what I have to do.

Hello

Thanks for your inquiry. Could you please attach your document and barcode font here for testing? I will check the problem on my side and provide you more information.

Best regards,

Hello,

hereby a document which prints well in word and doesn't print wel in ASPOSE.

I have also included the font file.

thanks.

ps. Sorry for reaction so late, but we had 2 public holidays last week and I was out of office

Hello

Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words (10.1.0) for testing.

You can download the latest version from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

Best regards,

Hello,

before I try a new version, is it easy for you to test it also on the 9.1 version, whcih we are using. I have no problem going to a new version, however, I need to go through a long test. And maybe I am doing something wrong. If 9.1 is not working for you, I will try version 10

thanks

Hello

Thanks for your inquiry. I have tested with Aspose.Words 9.1.0 and I managed to reproduce the problem. So could you please try using the latest version and let me know how it goes on your side.

Best regards,

Hello,I have downloaded the 10.1 verson.But I get an error. This is what we used to do for printing to a print job on the server:

public static void Print(Aspose.Words.Document document, string printerName, string jobName, bool isWait)
{
if (document == null)
throw new ArgumentNullException("document");

// Use Aspose.Words to convert the document to XPS and store in a memory stream.
MemoryStream stream = new MemoryStream();
document.SaveToXps(0, document.PageCount, stream, null);
stream.Position = 0;
Print(stream, printerName, jobName, isWait);

}Jowever the SaveToXps doesn't work anymore.

What should I use now to print to a stream which can be added to a printerName and JjobName?

thanks bert

Hello,I have downloaded the 10.1 verson.But I get an error. This is what we used to do for printing to a print job on the server:

public static void Print(Aspose.Words.Document document, string printerName, string jobName, bool isWait)
{
if (document == null)
throw new ArgumentNullException("document");

// Use Aspose.Words to convert the document to XPS and store in a memory stream.
MemoryStream stream = new MemoryStream();
document.SaveToXps(0, document.PageCount, stream, null);
stream.Position = 0;
Print(stream, printerName, jobName, isWait);

}

However the SaveToXps doesn't work anymore.

What should I use now to print to a stream which can be added to a printerName and jobName?

thanks bert

Hello

There were a few breaking changes to the API in version 9.2/9.5 You can find full details of these changes in the migration article:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-migrate-to-aspose-words-9-2-or-higher.html

SaveToXps method was replaced with Save method.

Best regards,

Hi

Thanks for your request. You should use Save method to save your document to XPS. Please see the following code:

MemoryStream stream = new MemoryStream();

document.Save(stream, SaveFormat.Xps);

Hope this helps.

Best regards,

Hi,

i have downloaded 10.1. Made the changes. It prints, however, not the barcode font.

Anything else I should do?

thanks

Hi

Thanks for additional information. Please make sure that Barcode font is installed on the PC where you perform conversion to XPS. If not, please try to install this font. This should fix the problem. Please let me know in case of any issues.

Best regards,

Hi,

the font is installed and on the PC (server) there is still a Word2003 version. And if I open the file I see the BarCode (also with printing).

I have installed this on the life environment and everything else works.

I will create a short solution and will try to emulate the same behaviour.

See attachment for installed fonts and a screen print from Word.

bert

Hi

Thank you for additional information. I checked on my side and barcode font is properly rendered in XPS document produced by Aspose.Words. Could you please attach XPS document produced on your side? We will check it and provide you more information.

Best regards,

Hi Alexey

thanks for your help. I have created a small project with the following code:

namespace BarCode
{
class Program
{
static void Main(string[] args)
{
InitAspose();
PrintFile("Example.docx", "Example.xps");
}

private static void PrintFile(string wordFile, string xpsFile)
{
Aspose.Words.Document document = new Aspose.Words.Document(wordFile);
document.Print("Samsung CLP-310 Series");

}

private static void InitAspose()
{
Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense("Aspose.Words.lic");
}
}
}

And that works :)

So it is something in my program. Thanks for you fantastic support and the fast reply.

Wonderfull.

re Bert

Hello

Please let us know in case of any issues. We will be glad to help you.

Best regards,