Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Export as HTML, RTF, ...
utelle:
--- Quote from: 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?
--- End quote ---
Yep, that's what I mean.
--- End quote ---
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.
--- End quote ---
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);
--- End code ---
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?
--- End quote ---
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
Ceniza:
--- Quote from: utelle ---Could you please explain, what you are trying to accomplish?
--- End quote ---
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
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.
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.
utelle:
--- Quote from: Ceniza on November 05, 2005, 12:45:30 am ---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.
--- End quote ---
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
Ceniza:
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 :)
kisoft:
--- Quote from: Ceniza on November 07, 2005, 06:10:20 am ---...
I committed the PDF exporter a few hours ago, even though I had some problems adding the folder with wxPdfDocument sources.
...
--- End quote ---
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]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version