Rpreview issues - PDF
Re: Rpreview issues - PDF
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/b ... t/main.prg
see https://github.com/APerricone/emf2pdf/b ... t/main.prg
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Rpreview issues - PDF
I have seen mastintin's reference to your post.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/b ... t/main.prg
Later he said he tested and it is not fully developed.
We have not tried it yet.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Rpreview issues - PDF
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?
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?
Re: Rpreview issues - PDF
AntoninoP, Add this in your code ...
Saludos.
Code: Select all
void Emf2Pdf::ParseFile()
.....
case EMR_RECTANGLE: nRead += Rectangle(); break;
....
Code: Select all
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;
}
Saludos.
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Rpreview issues - PDF
If we use this code, may I know what libraries we need to link to our application?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Rpreview issues - PDF
@Maustin done, have you tried it? I will do a test ASAP.
@Nages It uses libHaru, with hbmk2 it is enough add hbhpdf.hbc, see this hbmk2 project file
@Nages It uses libHaru, with hbmk2 it is enough add hbhpdf.hbc, see this hbmk2 project file
Re: Rpreview issues - PDF
Yes. I've tried it with a simple listing.AntoninoP wrote:@Maustin , have you tried it? I will do a test ASAP.
pdf generate
preview original
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Rpreview issues - PDF
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
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
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Rpreview issues - PDF
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)
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)
Last edited by mastintin on Wed May 08, 2019 10:11 am, edited 1 time in total.
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Rpreview issues - PDF
The results are EXCELLENT !!!
File size is very small. Better than the pdf created by MsWord.
It is enough for us if it can embed an array of emf files into a multipage pdf.
We do not need anything more for our work.
For example:
XBROWSER "customer.dbf"
If this preview is saved as pdf, that should be fine for us. Do you agree?
We need to study the licensing terms about including the library.
File size is very small. Better than the pdf created by MsWord.
I do not understand. Can you please clarify?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.
It is enough for us if it can embed an array of emf files into a multipage pdf.
We do not need anything more for our work.
For example:
XBROWSER "customer.dbf"
If this preview is saved as pdf, that should be fine for us. Do you agree?
We need to study the licensing terms about including the library.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Rpreview issues - PDF
Nages ...
Here the emf is not embedded in the pdf.
Here the code analyze the content of the emf and convert it to pdf format.
For example: The emf is analyzed and a text is found, this text is passed to pdf text (with all the advantages of size and possibility of searching).
It is a Rectangle is passed to rectangle pdf ... etc.
But if the preview has a bitmap logo? ... this is not yet implemented ( I think, ), so it would not work ...
He also seems to have problems with some character such as the €
See this :
Here the emf is not embedded in the pdf.
Here the code analyze the content of the emf and convert it to pdf format.
For example: The emf is analyzed and a text is found, this text is passed to pdf text (with all the advantages of size and possibility of searching).
It is a Rectangle is passed to rectangle pdf ... etc.
But if the preview has a bitmap logo? ... this is not yet implemented ( I think, ), so it would not work ...
He also seems to have problems with some character such as the €
See this :
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Rpreview issues - PDF
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.
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.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Rpreview issues - PDF
For a long time I also use Harupdf from Carlos Mora lib: https://bitbucket.org/carlos_mora/pdfprinter, with some modifications of Manuel, to print pdfs on FivEdit with fantastic results
I did not know about Antonino's work, and I'm also going to try it
I did not know about Antonino's work, and I'm also going to try it
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Re: Rpreview issues - PDF
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
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