Forum > FPvectorial
FPvectorial "Unsupported vector graphics" - PDF
(1/1)
gummi.bear:
I am trying to plot a pdf file to a canvas using the procedure
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TmainForm.plotPDF(PlotFileName: string; Dest: TCanvas);var Vec : TvVectorialDocument; lFormat: TvVectorialFormat;begin Vec := TvVectorialDocument.Create; try lFormat := TvVectorialDocument.GetFormatFromExtension(PlotFileName); Vec.ReadFromFile(PlotFileName, lFormat); DrawFPVectorialToCanvas(Vec.GetPageAsVectorial(0), Dest, 0, 0, 1.0, -1.0); finally Vec.free; end;end;
but I am getting the "Unsupported vector graphics format." message from Vec.ReadFromFile(PlotFileName, lFormat). Are there some requirements on the format of the pdf files? My pdfs are generated by R (attached below).
wp:
Since fpvectorial links reader/writer units only for the formats needed you must add pdfvectorialreader to the uses clauses of your program. But I doubt that you'll be able to read this file with fpvectorial. As I saw recently this format is supported only in a very basic way.
molly:
--- Quote from: gummi.bear on September 15, 2017, 02:17:39 pm ---
--- Code: --- Vec.ReadFromFile(PlotFileName, lFormat);
--- End code ---
but I am getting the "Unsupported vector graphics format." message from Vec.ReadFromFile(PlotFileName, lFormat). Are there some requirements on the format of the pdf files? My pdfs are generated by R (attached below).
--- End quote ---
According to fpvectorial textdoc wiki:
--- Quote ---TODO
General
* Comprehensive testing, including opening the files in as many word processors and office suites as possible.
* DOCX and ODT Readers (volunteers required)
* Add PDF reader/writer (current PDF support is for Vector Image support only)
* Add HTML reader/writer
* Add RTF reader/writer
* Produce well documented examples and store in FPVectorial/Examples
* Code Documentation for distributing with Lazarus
--- End quote ---
and fpvectorial wiki reads:
--- Quote ---Readers for various image formats:
pdfvectorialreader - Read support for PDF files, supports compression, only reads the first page
--- End quote ---
gummi.bear:
--- Quote ---Readers for various image formats:
pdfvectorialreader - Read support for PDF files, supports compression, only reads the first page
--- End quote ---
My pdf files have one page only and should be vector images. I also tried to turn off the compression in R, but it didn't help. I assumed that there is some support for pdf files because they are mentioned on the wiki page. So maybe only my format is wrong?
wp:
The problem is that the pdfreader does not even compile... It is certainly not too difficult to make it work, but I don't have the time to focus on this issue. Patches are welcome.
Navigation
[0] Message Index