Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: Ceniza on October 13, 2005, 02:04:43 am

Title: Export as HTML, RTF, ...
Post by: Ceniza on October 13, 2005, 02:04:43 am
I've been considering to write a plugin to export the current opened file in Code::Blocks with highlighted syntax to HTML, RTF and maybe some other formats, just like Dev-C++ and SciTE do.

I've spent a lot of time trying to get all I need to extract the information from the wxScintilla component and Code::Blocks itself so I can get the colors and style.

ATM I've only needed to add a GetColorSet() method to get m_pTheme from cbEditor and it seems to be the only decent way to get what I need, and the only thing I'd really need to be added in the SDK (I hope).

Any complaints, ideas, support, ...?
Title: Re: Export as HTML, RTF, ...
Post by: mandrav on October 13, 2005, 09:46:55 am
No problem for me, after RC2 of course.
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 16, 2005, 03:51:44 am
It seems like that will be really the only needed change in the SDK to get the plugin working.

I've made a few tests, played a bit with some stuff and everything else I'll need is in there.

mandrav: Would you really mind to add that function before RC2 is released? It won't change any behavior of it.

Code
EditorColorSet* cbEditor::GetColorSet()
{
  return m_pTheme;
}

EDIT: Yeah, forgot why: the idea is to get it done maybe, just maybe, before RC2 is released or at least have RC2 ready for it.
Title: Re: Export as HTML, RTF, ...
Post by: mandrav on October 16, 2005, 10:23:58 am
Done :)
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 16, 2005, 07:15:23 pm
Done :)

Oh, great!

I just finished the first version of it.

It currently exports HTML and seems to be working fine. I still need to add some more things to get it more "real" (WYSIWYG).

A sample file is here (http://gda.utp.edu.co/~ceniza/CodeBlocks/Exporter_plugin/wxZViewer.html)

mandrav: would you mind to add this (http://gda.utp.edu.co/~ceniza/CodeBlocks/Exporter_plugin/exporter.zip) to contrib?
Title: Re: Export as HTML, RTF, ...
Post by: mandrav on October 17, 2005, 11:46:09 am
Quote
mandrav: would you mind to add this to contrib?

Done.
I hope you don't mind, I converted it to cbPlugin and now creates a "File->Export to HTML" menu item. ;)
Btw, very nice work  8)
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 17, 2005, 06:33:37 pm
Quote
mandrav: would you mind to add this to contrib?

Done.
I hope you don't mind, I converted it to cbPlugin and now creates a "File->Export to HTML" menu item. ;)
Btw, very nice work 8)

Heh, in the first tests I was doing something similar (adding it in the File menu) but then decided to make it more... er... plugin-like.

Having it in the File menu will make it consistent 'cause there's where ppl can find it in both SciTE and Dev-C++, so I don't really mind the change.

Last night I was checking some other minor things so it'll also export the font (name and size). This should be ready today.

I just hope you didn't forget to give me access to the plugin in CVS, oh, and still have access to the other two :P
Title: Re: Export as HTML, RTF, ...
Post by: mandrav on October 17, 2005, 06:44:43 pm
Quote
I just hope you didn't forget to give me access to the plugin in CVS, oh, and still have access to the other two

I hope I haven't ;)
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 17, 2005, 09:14:28 pm
I just committed the latest changes and CVS didn't complain :)

Changes include:

* Current font type and size exported to the HTML file.
* Background colors also exported.
* Applied my coding style to mandrav's changes :)
* Removed the unnecessary checking mandrav pointed out (because of the new way to execute).
* Probably a few bugs introduced in the code :P
Title: Re: Export as HTML, RTF, ...
Post by: squizzz on October 17, 2005, 09:29:20 pm
Quote from: Ceniza
HTML, RTF and maybe some other formats
Others, like Open Document Format for example? :)
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 17, 2005, 10:19:20 pm
Quote from: squizzz
Others, like Open Document Format for example? :)

I'mn't any familiar with that format, but yeah, it could be part of other formats.

I'll consider it :)
Title: Re: Export as HTML, RTF, ...
Post by: rickg22 on October 17, 2005, 10:42:46 pm
OpenDocument format is the format used by OpenOffice, KOffice and other OpenSource word processors. There was quite a political stir when the state of Massachusetts rejected the Microsoft format in govt. offices for an open document format to avoid vendor lock-in. The OpenDocument format is XML based, and currently is proposed to be an ISO standard.
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 18, 2005, 04:21:52 am
I just tried converting a RTF file (generated with Dev-C++) to ODT and it's too bloated.

I think the ODT format will have to wait some time until I get enough information to generate it in a simple, non-bloated, way.

I hope to get the RTF format soon though.
Title: Re: Export as HTML, RTF, ...
Post by: Urxae on October 18, 2005, 10:10:36 am
I think the ODT format will have to wait some time until I get enough information to generate it in a simple, non-bloated, way.

I haven't looked at the details myself, but the information is probably available somewhere on this site (http://www.oasis-open.org/home/index.php).
Title: Re: Export as HTML, RTF, ...
Post by: squizzz on October 18, 2005, 11:49:02 am
I think the ODT format will have to wait some time until I get enough information to generate it in a simple, non-bloated, way.
I'm afraid that everything XML-based is bloated by default. The good thing is that it usually compresses very well (*.odt uses zip compression I think).

There was quite a political stir when the state of Massachusetts rejected the Microsoft format in govt. offices for an open document format to avoid vendor lock-in.
Yeah, that's when I've heard of this and decided to switch. (btw. OOo 2.0 itself is good enough reason to switch :P )

Anyway, great thanks for the plugin. :D
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 18, 2005, 04:11:46 pm
Quote from: squizzz
I'm afraid that everything XML-based is bloated by default. The good thing is that it usually compresses very well (*.odt uses zip compression I think).

Well, I'll have to take a deeper look at it. All I know now about its structure is it's compressed in ZIP format, composed of a few XML files and some folders... and OOo ouput is really bloated for this format.

I'll just get the specs file and play a bit, but later.

Quote from: squizzz
Anyway, great thanks for the plugin. :D

Heh, no problem :)
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 21, 2005, 04:27:47 am
Well, well, well, ...

RTF support has been added to the plugin. It seems to be working fine but I cannot say it's bugless (I'm kinda tired) :P

Dealing with it I found there's no OptionColor object with value 11 in Code::Blocks' C/C++ color theme and it's used everywhere in wxScintilla (at least everywhere no special formatting is applied to the text).

Is that somehow intentional or did I, or a developer, miss something?

Anyway, it's already committed to CVS if anyone feels like trying it.
Title: Re: Export as HTML, RTF, ...
Post by: mandrav on October 21, 2005, 09:18:09 am
Quote
Dealing with it I found there's no OptionColor object with value 11 in Code::Blocks' C/C++ color theme and it's used everywhere in wxScintilla (at least everywhere no special formatting is applied to the text).

11 is for "identifier". This means, according to my tests, every word that is not a keyword. So, we use the default text attributes for it.
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 21, 2005, 06:09:55 pm
Quote from: mandrav
11 is for "identifier". This means, according to my tests, every word that is not a keyword. So, we use the default text attributes for it.

But... 11 is not in OptionColor, so it, being undefined there, is just used for "default"?

My solution was: if the style is not found select the default.

I still wonder why using a style that isn't there...
Title: Re: Export as HTML, RTF, ...
Post by: rickg22 on October 21, 2005, 07:44:27 pm
There are a lot of styles in scintilla, depending on the language.
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 21, 2005, 08:11:15 pm
Quote from: rickg22
There are a lot of styles in scintilla, depending on the language.

I'm talking specifically about the C/C++ syntax highlighting.

I found all the styles (I use the word style to refer to the specific color and text formatting of an item, being an item a keyword, a string, a number, ...) are stored in a struct named ObjectColor in Code::Blocks.

That struct holds its name, value, foreground, background, bold, italic, underline and if it's a style.

The variable value holds the style number used by wxScintilla. In other words, it's the key that maps a specific formatting with its stored value in wxScintilla.

The thing is: wxScintilla is using a style with value 11 for identifiers, which isn't in any of those ObjectColor for the C/C++ color theme.

By not being there it should become the default style (and the default style happen to exist in ObjectColor).

The question is: leaving style 11 out of ObjectColor was intentional just to make it map to default?
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 22, 2005, 12:04:56 am
I would like to inform you I've already started playing with the ODT format and I've got all I need to start making the plugin, except time.

I really wanna get this third format working so I'll try to get some time for it soon.

What do you think of PDF as a fourth format? I'd need to start playing with it too, but I think it would be nice.
Title: Re: Export as HTML, RTF, ...
Post by: rickg22 on October 22, 2005, 12:45:31 am
eew! PDF!  :| Well, I guess it's the users' choice. But don't be too quick on implementing features if nobody has asked for them.
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 22, 2005, 03:14:05 am
Well, I considered PDF 'cause it's a popular one, almost like HTML and RTF are (please, don't go off-topic about this sentence).

ODT in the other hand was a feature request (or format request :P) which is good, I think.

Imagine: "Code::Blocks... the first IDE to support ODT file exporting." :)
Title: Re: Export as HTML, RTF, ...
Post by: takeshimiya on October 22, 2005, 03:21:11 am
Yeah, and try to support what SciTE supports, so one would have less reasons for using SciTe and more for using C::B  :)

Namely: HTML, RTF, PDF, LaTeX, XML export support.

Off-topic: Regarding SciTE, I would like to see C::B scripting in lua embedded, just like SciTE does (using it for macros, extended functionality, etc).
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 23, 2005, 11:49:41 pm
I've just finished the first version of the ODT exporter.

I've exported a few files and checked how they look and it seems to be working fine so far.

The PDF exporter could be released soon thanks to wxPdfDocument @ wxCode. The drawback I've found is I'd have to force the font to be Courier or any other working one.

Well, I'll just commit it.
Title: Re: Export as HTML, RTF, ...
Post by: takeshimiya on October 24, 2005, 02:24:28 am
In PDF? But you can't embedd fonts inside a PDF (I don't remember well, but PDF wasn't a vectorial format?).

For ODT also, you can't embedd fonts?
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 24, 2005, 03:57:44 am
Quote from: takeshimiya
In PDF? But you can't embedd fonts inside a PDF (I don't remember well, but PDF wasn't a vectorial format?).

All I know is wxPdfDocument has limited font support. I tried Courier and it works fine (but it knows nothing about "Courier New"). In fact, SciTE uses Helvetica as output for PDFs. wxPdfDocument developers seem to be working in some kind of solution, but I don't know the details.

PDF has support for vector graphics and the text is stored as such (or at least that says Wikipedia).

Quote from: takeshimiya
For ODT also, you can't embedd fonts?

No idea, but just adding their name in the styles file was enough (as far as you have it installed).
Title: Re: Export as HTML, RTF, ...
Post by: utelle on October 27, 2005, 04:46:14 pm
All I know is wxPdfDocument has limited font support.
That's not exactly true. By default wxPdfDocument supports the standard Adobe fonts, i.e. Courier, Times, Helvetica (=Arial), Symbol and ZapfDingBats. Additionally Type1, TrueType and TrueTypeUnicode fonts are supported if the user provides at least font metric files. Usually these fonts have to be embedded in the PDF document. What's missing in the current version of wxPdfDocument is a tool to create these font metrics files from AFM or TTF files.
Quote from: Ceniza
I tried Courier and it works fine (but it knows nothing about "Courier New"). In fact, SciTE uses Helvetica as output for PDFs. wxPdfDocument developers seem to be working in some kind of solution, but I don't know the details.
Courier New is essentially Courier, no need to embed the font Courier New unless you need Unicode or foreign language support; Helvetica should work without problems, too.

As the font example which comes with wxPdfDocument shows font embedding works. And the next version will include a tool to create the necessary font metric files. The release of the next version is planned for November.

Regards,

Ulrich
(Developer of wxPdfDocument)
Title: Re: Export as HTML, RTF, ...
Post by: thomas on October 27, 2005, 05:28:39 pm
I would be very very careful about embedding fonts or font-related information in a PDF.

Certain companies can be get very nasty if you do that. Remember some companies even regard adjusting character stem widths or the mere drawing of cubic bezier curves as a violation of intellectual property.

It is really hilarious, but remember what happened to Dmitry Sklyarov after the DefCon 2001, too.
They might actually arrest you because you write software that enables the unauthorized copying of font metrics...
Title: Re: Export as HTML, RTF, ...
Post by: rickg22 on October 27, 2005, 06:08:02 pm
Regards,

Ulrich
(Developer of wxPdfDocument)

Wow! :shock: It is an honor having you here! :) Welcome!
Title: Re: Export as HTML, RTF, ...
Post by: utelle on October 27, 2005, 06:55:21 pm
I would be very very careful about embedding fonts or font-related information in a PDF.

It is common practice to embed fonts in PDF files. There is nothing special about that. Almost all tools for creating PDF files allow this. For example Adobe Acrobat, or the commercial libraries PDFLib and CPDFLib, or open source libraries like libharu, or FPDF to name just a few. Neither Adobe nor PDFLib GmbH nor FastIO nor any developer can control the user. They can't stop him to embed fonts he doesn't own or which are not freely available. Nevertheless these products/libraries are sold resp. distributed.

Quote from: thomas
Certain companies can be get very nasty if you do that. Remember some companies even regard adjusting character stem widths or the mere drawing of cubic bezier curves as a violation of intellectual property.

Certainly a user has to respect the font licences. wxPdfDocument will not provide any font metric files, instead there will be a tool to create special wxPdfDocument font metric files (containing only the information needed to properly use a font with wxPdfDocument). To create these files the user has to provide an AFM or UFM file for the font he wants to embed. It is assumed that the user owns the right to use the fonts, as each of the companies named above assumes, too. For TrueType fonts the tool checks the font file whether the licence allows to embed the font file and respects this information.

Regards,

Ulrich
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on October 29, 2005, 05:55:03 pm
Regards,

Ulrich
(Developer of wxPdfDocument)

Wow! :shock: It is an honor having you here! :) Welcome!

Ditto.

The question is: there will be a way to embed the fonts just by calling a class method and providing the font face name without calling external utilities?

Oh, could I also suggest wxPdfDocument's makefile allow static compilation using dynamic wxWidgets? I've got a working one already and seems to be working just fine.
Title: Re: Export as HTML, RTF, ...
Post by: utelle on October 29, 2005, 08:32:13 pm
Wow! :shock: It is an honor having you here! :) Welcome!
Ditto.

Thanks. :D

Quote from: Ceniza
The question is: there will be a way to embed the fonts just by calling a class method and providing the font face name without calling external utilities?

To use a non-standard font (i.e. oher than Courier, Times, Helvetica=Arial, Symbol, ZapfDingBats) wxPdfDocument needs some information about these fonts - for example the width of each character provided by the font, the underline position etc. In the next release of wxPdfDocument there will be a small utility (MakeFont) which allows to create a wxPdfDocument specific font metric file and to prepare the font for embedding. An application using wxPdfDocument needs only these generated files at runtime. To make such a font known to wxPdfDocument, the application has to call the method AddFont (see the font embedding example of the wxPdfDocument distribution).

Although it would be possible to extract the needed font information on the fly I do not plan to implement such a feature. The reasons are efficiency (it makes no sense to extract the font information again and again each time the application runs) and legal issues (it may not be allowed to embed a specific font).

Quote from: Ceniza
Oh, could I also suggest wxPdfDocument's makefile allow static compilation using dynamic wxWidgets? I've got a working one already and seems to be working just fine.

Do you mean to compile wxPdfDocument as a static library while using wxWidgets as a shared/dynamic library?

I use bakefile (also used by wxWidgets) to generate the makefiles for wxPdfDocument. As far as I know bakefile currently supports only the combinations "static library + static wxWidgets library" and "dynamic library + dynamic wxWidgets library", but I'll investigate this issue.

Of course you always could simply add the wxPdfDocument source files to your own project.

Regards,

Ulrich
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 04, 2005, 08:29:30 pm
Quote from: utelle
Do you mean to compile wxPdfDocument as a static library while using wxWidgets as a shared/dynamic library?

Yep, that's what I mean.

Quote from: utelle
Of course you always could simply add the wxPdfDocument source files to your own project.

That's what I did :P

I've been working on the PDF exporter and it's... exporting, but I've been unable to allow text background to be drawn correctly, if any.

Code
pdf.Cell(pdf.GetStringWidth(text), 4, text);//, wxPDF_BORDER_NONE, 0, wxPDF_ALIGN_LEFT, 1);

That's my current text drawing call (ugly hack to get it working). If I enable the commented piece, some of the previous text will be also painted white (or should I say erased?).

Any idea?
Title: Re: Export as HTML, RTF, ...
Post by: utelle on November 04, 2005, 11:44:47 pm
Quote from: utelle
Do you mean to compile wxPdfDocument as a static library while using wxWidgets as a shared/dynamic library?
Yep, that's what I mean.

Currently no news on this topic. I drop a note here if I find a way to accomplish this.

Quote from: Ceniza
I've been working on the PDF exporter and it's... exporting, but I've been unable to allow text background to be drawn correctly, if any.

Could you please explain, what you are trying to accomplish? The method Cell allows to draw a text background color, as shown for example in sample tutorial3.cpp. If a specific area of the page should have a background color you could also use the method Rect to draw a colored rectangle. If you do this before writing the text the text will be visible.

Quote from: Ceniza
Code
pdf.Cell(pdf.GetStringWidth(text), 4, text);//, wxPDF_BORDER_NONE, 0, wxPDF_ALIGN_LEFT, 1);

That's my current text drawing call (ugly hack to get it working). If I enable the commented piece, some of the previous text will be also painted white (or should I say erased?).

Any idea?

Unfortunately no. As stated above enabling the Cell options should work as it does in the samples. But maybe there is a bug in wxPdfDocument. Could you quote - here or in a private message - the code which produces the unwanted result and the resulting PDF file? (To allow me easier inspection of the generated PDF file please use SetCompression(false) after instantiating wxPdfDocument.)

Regards,

Ulrich
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 05, 2005, 12:45:30 am
Quote from: utelle
Could you please explain, what you are trying to accomplish?

In the editor, you can choose a background color for something, lets say... strings: blue text on black (I know they don't mix, but it's just an example).

This is the result

(http://gda.utp.edu.co/~ceniza/CodeBlocks/Exporter_plugin/blackbgPDF.png)

I just tried without compression and it seems the problem is here:

109.95 280.63 67.20 -11.34 re f q 0.000 0.000 1.000 rg BT 112.79 272.56 Td ("Calligrapher") Tj ET Q

I just played with those values and they seem to be causing the white border around that's deleting some of the previous written text.

Here's the PDF file (http://gda.utp.edu.co/~ceniza/CodeBlocks/Exporter_plugin/blackbg.zip).

I just enabled the commented bit of code to create it.

In a few words: I set a font, style and color. Write some text using that function. Change style and color. Write some more text, and so on.

I hope it be of any use so you can track down the problem.

Thanks in advance.
Title: Re: Export as HTML, RTF, ...
Post by: utelle on November 05, 2005, 03:42:30 pm
In the editor, you can choose a background color for something, lets say... strings: blue text on black (I know they don't mix, but it's just an example).
[...]
I just played with those values and they seem to be causing the white border around that's deleting some of the previous written text.

In a few words: I set a font, style and color. Write some text using that function. Change style and color. Write some more text, and so on.

I hope it be of any use so you can track down the problem.

Well, it's not exactly a bug, you may call it a feature.  :wink:

The Cell method assumes an internal cell margin to the left and to the right of the text. This cell margin is set to 1 millimeter in the wxPdfDocument constructor and - unfortunately - there is no method to manipulate this margin at the moment. I will add one in the next release. The cell margin is subtracted two times from the cell width and then the text is aligned in the remaining space as requested. Usually this is ok and gives pleasant results. In your case the cell width is equal to the text width. Nevertheless, the Cell method adds the cell margin as an offset on the left side of the cell. This causes the text to extend beyond the right side by the same amount and so 1 mm of the previous text is overwritten by the next call to Cell.

As an interim solution you could add 2 mm to the cell width parameter of the Cell method.

Regards,

Ulrich
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 07, 2005, 06:10:20 am
Well, in the meanwhile I'll keep the cell filling disabled...

I committed the PDF exporter a few hours ago, even though I had some problems adding the folder with wxPdfDocument sources.

After a bunch of cvs add and a final cvs ci I got them there. There must be an easier way to do that, mabye using cvs import but..., once again, the files are already there.

utelle: I'll be waiting for the next release then :)
Title: Re: Export as HTML, RTF, ...
Post by: kisoft on November 08, 2005, 01:22:57 pm
...
I committed the PDF exporter a few hours ago, even though I had some problems adding the folder with wxPdfDocument sources.
...

I compile CVS C::B today. Export a source file to PDF, and look strange (I mean), see screenshot.
On figure 1 see, then a bottom lines lies closed to bottom edge of list. Hmm..
On figure 2 see, then text (wide line) goes out of list (may be my problem, don't try another variants).

In other hands allright! Thanks!  :lol:


[attachment deleted by admin]
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 08, 2005, 05:23:21 pm
I noticed the problem in 2 but couldn't find a good way to solve it. The method Write is the one that should be used there, but it's adding a lot of spacing between text and wouldn't allow me to add a background (I'd say the spacing is a bug in Write). Cell isn't breaking line when it reaches the right margin, but it allows me to put a background (which currently I disabled due to the white border that erases the previous text).

Trying to solve that problem I called another function, but it didn't solve it (it was for something else) and caused what you see in 1.

I just removed that function call and 1 is gone.

2 will have to wait for a fixed Write, a fixed and smarter Cell, a fixed Write with a background option or a new function doing that.

I'll just commit that change and with my head in my hands I'll sit and cry.

Forget the last bit :P
Title: Re: Export as HTML, RTF, ...
Post by: kisoft on November 09, 2005, 08:27:55 am
...
I just removed that function call and 1 is gone.
...

I see (compile now CVS). Look better! Thanks!  8)

So, in save dialog, FileName field - empty string.
Why not set it an exported fileName (w/o extention, or with extention, need see)?
I try export some times, and it already anoyed me  :(
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 09, 2005, 02:00:57 pm
Quote from: kisoft
So, in save dialog, FileName field - empty string.
Why not set it an exported fileName (w/o extention, or with extention, need see)?

I always considered that bit, but never implemented it. I'll try to get it soon... maybe today :)
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 09, 2005, 02:42:57 pm
Ok, I just committed the changes to CVS. It should be visible for anonymous CVS in a few hours.
Title: Re: Export as HTML, RTF, ...
Post by: kisoft on November 09, 2005, 03:03:55 pm
Ok, I just committed the changes to CVS. It should be visible for anonymous CVS in a few hours.

So, I can sleep while  :D
Title: Re: Export as HTML, RTF, ...
Post by: kisoft on November 10, 2005, 08:05:07 am
Ok, I just committed the changes to CVS. It should be visible for anonymous CVS in a few hours.

Ok, good work!  8)

I have trouble with my russian symbols in PDF, will see later.

Good luck!
Title: Re: Export as HTML, RTF, ...
Post by: utelle on November 26, 2005, 12:06:16 am
The method Write is the one that should be used there, but it's adding a lot of spacing between text and wouldn't allow me to add a background (I'd say the spacing is a bug in Write).

Yes, there was a bug in method Write. But I have fixed it at last. And there is now an additional method WriteCell allowing to specify a background color.

Quote from: Ceniza
Cell isn't breaking line when it reaches the right margin, but it allows me to put a background (which currently I disabled due to the white border that erases the previous text).

The method Cell still takes a cell margin into account, but method Write resp WriteCell now uses internally a cell margin of 0.

Quote from: Ceniza
2 will have to wait for a fixed Write, a fixed and smarter Cell, a fixed Write with a background option or a new function doing that.

I'll just commit that change and with my head in my hands I'll sit and cry.

Version 0.6 of wxPdfDocument (http://wxcode.sourceforge.net/components/wxpdfdoc) including the fixes mentioned above and several other enhancements is available for download. The API documentation has been updated accordingly.

Have fun with the new release!  :)

Regards,

Ulrich
Title: Re: Export as HTML, RTF, ...
Post by: utelle on November 26, 2005, 12:13:25 am
I have trouble with my russian symbols in PDF, will see later.

Unfortunately this is not trivial to solve. The Adobe standard fonts don't support cyrillic letters. You'll have to use and embed an appropriate cyrillic font into the PDF document. wxPdfDocument (http://wxcode.sourceforge.net/components/wxpdfdoc) now contains a utility, MakeFont, which assists you in creating the necessary support files. See the documentation for further details.

Regards,

Ulrich
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 26, 2005, 12:29:14 am
Quote from: utelle
Version 0.6 of wxPdfDocument including the fixes mentioned above and several other enhancements is available for download. The API documentation has been updated accordingly.

Great! Thanks for having it all in mind :)

I'll give it a try ASAP and hope next week I can commit a new version of the PDF Exporter.

Thanks again :)
Title: Re: Export as HTML, RTF, ...
Post by: Ceniza on November 26, 2005, 05:16:59 pm
I just committed the new version of wxPdfDocument to the SVN repository and made the changes in the PDF exporter plugin to use WriteCell and works lovely (line wrapping and fill colour) :)

Thanks utelle, once again.