#1 2011-03-21 20:11:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Export a document from TGDIPages to a bitmap, jpeg...

pplegrub wrote:

The framework is fantastic and I am a beginner in Delphi. I have achieved what I intended but cannot find any way to do the following two actions simply.

1. Export a document from TGDIPages to a bitmap, jpeg, tiff, png or any other graphic.
2. Any security settings to prevent users from altering the pdf contents.

I would prefer to just same the document as a pdf image that is not editable - is this possible and could you please assist.

1. To export TGDIPages to pictures, you can access to the page content from the Pages string list property.

Each Pages.Objects[] is a TMetaFile.

So to write all pages as jpeg:

      for i := 0 to Pages.Count-1 do
        SynGdiPlus.SaveAs(TMetafile(Pages.Objects[i]),
          IntToStr(i+1)+'.jpg',gptJPG,80,1024);

2. There is no encryption implemented yet in pdf generation.

But if you set ExportPDFA1 := true it will generate a PDF/A-1 file, which could not be modified.

Offline

Board footer

Powered by FluxBB