see https://github.com/APerricone/emf2pdf/blob/master/FWH_Test/main.prg
see https://github.com/APerricone/emf2pdf/blob/master/FWH_Test/main.prg
AntoninoP wrote:I use libHaru for EMF 2 PDF, here https://github.com/APerricone/emf2pdf but the support is limited of what I need
see https://github.com/APerricone/emf2pdf/blob/master/FWH_Test/main.prg
Ops. instead I missed the mastintin's reference
I made some modification at the library because this thread, and now the example is working.
In our program we use this lib to convert reports to pdf, so the support is limited.
@maustin what did you try to crash the exporter?
void Emf2Pdf::ParseFile()
.....
case EMR_RECTANGLE: nRead += Rectangle(); break;
....size_t Emf2Pdf::Rectangle()
{
RECTL bound;
fread(&bound, 4, 4, f);
float x = bound.left * xScale ;
float y = currHeight - bound.bottom * yScale ;
float rx = ( bound.right - bound.left) * xScale ;
float ry = (bound.bottom - bound.top) * yScale ;
HPDF_Page_Rectangle(page, x, y, rx, ry ) ;
if (currentPen.width > 0 && currentBrush.solid)
{
HPDF_Page_FillStroke(page);
}
else if (currentPen.width > 0)
{
HPDF_Page_Stroke(page);
}
else if (currentBrush.solid)
{
HPDF_Page_Fill(page);
}
return 16;
}If we use this code, may I know what libraries we need to link to our application?
AntoninoP wrote:@Maustin , have you tried it? I will do a test ASAP.


Can one of you be kind enough to do me favour?
I posted a sample program on the 1st page of this post.
Can pdf be generated from that program and post a screen-shot and also let us know the size of pdf file.
That would be very educative for many of our users.
Next question:
If FWH uses this function, no application can be built with FWH without linking with libharu.lib.
Can FWH distribute libharu.lib with its distribution?
Or should this function be made available to users to use it at their choice and in that case they will obtain libharu.lib and link
Nages...
1.- libHaru is a free, cross platform, open source library for generating PDF files. ... from http://libharu.org/
2.- hbpdf library is in harbour/contrib .
3.- According to AntoninoP , I would prefer to decide whether or not to include libharu.
use this is a good idea to force the use depending on the case :
TPreview():bSaveAsPDF := {|o| TPrinter2PDF(o:oDevice)}
PRINT oPrn PREVIEW
4.- still work in the process to generate pdf from emf.
I would not say that it is usable in production for all cases, only for the simplest.
Missing the roundrectangles, insertion of images (especially bmp), etc, etc.
For text and lines it is valid but they would lack color of lines, shadows etc
It's a very good idea that you lack development (time) ![]()
4.- still work in the process to generate pdf from emf.
I would not say that it is usable in production for all cases, only for the simplest.


Oh, I see.
I thought the emf is embedded into pdf as an image. That is what we require.
The image in emf may contain text, drawings, images, even totally unknown Unicode chars.
Hope our expert Mr. AntonioP can throw some light on this.

It is possible to embed an image in harupdf (jpg, png).
You can convert the emf in jpg or better in png, but this is where we lose quality and generate a very large pdf, and the text is not text is image.
The result would be similar to what we have now, only change Tpdf() code for Harupdf code ...
Regards