-
FlexPro
- At a Glance
- Features & Options
- Applications
- All Advantages
- What’s New in FlexPro 2021
- Try FlexPro For Free
- FlexPro View OEM Freeware
- Buying Guide
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Products
- News
- Support
- Company
- Contact
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
Automating JPEG export of charts
Home > Community > Automation and VBA > Automating JPEG export of charts
- This topic has 4 replies, 2 voices, and was last updated 9 years, 8 months ago by Michael Haag.
-
AuthorPosts
-
March 19, 2015 at 4:53 pm #12874Michael HaagMember
Dear Sir or Madam,
I have tried to automate the JPEG export of embedded charts. The document containig the charts is about 30 pages long and the number of charts is about 40.
In the HTML help I have found the following method:
Ausdruck.Export(Format, PathName, Interactive, PageNumber)
The arrays which contain the sheetnumber, the index of the chart and the Pathname are already definded.
So, my question is how do I have to write the method so that it is possible to export all charts by means of a for loop?
Specifically how is the appearance of the part “Ausdruck”? The part “Ausdruck” should contain expressions so that I can export each chart with the aid of a for loop.
Is that possible?
Yours sincerely
Mike
March 19, 2015 at 4:53 pm #8534Michael HaagMemberDear Sir or Madam,
I have tried to automate the JPEG export of embedded charts. The document containig the charts is about 30 pages long and the number of charts is about 40.
In the HTML help I have found the following method:
Ausdruck.Export(Format, PathName, Interactive, PageNumber)
The arrays which contain the sheetnumber, the index of the chart and the Pathname are already definded.
So, my question is how do I have to write the method so that it is possible to export all charts by means of a for loop?
Specifically how is the appearance of the part “Ausdruck”? The part “Ausdruck” should contain expressions so that I can export each chart with the aid of a for loop.
Is that possible?
Yours sincerely
Mike
March 20, 2015 at 9:57 am #9380Bernhard KantzParticipantThe easiest way to get images of all pages of a document is to export it as a HTML pageset. This creates .png images for all pages that can be post-processed to cut out the portions for the individual charts. One remark: for synthetic pictures, the png format yields better results than jpeg, the latter is optimized for photographs of natural scenes.
If you want to create single images from the charts, you have to loop over the pages of the document and for each page over the shapes. If the shapes DocObject is a Diagram2D (or Diagram3D) you can export it using the Export method mentioned in your posting.March 20, 2015 at 3:41 pm #9381Michael HaagMemberMany thanks for the quick reply!
Ok, I will consider your remark about the export format.Yes, the aim is to export all charts as a single image.
Unfortunately, I will not have access to a machine having FlexPro Professional installed within the next 4 days.
I must confess that I am a newbie in VBA programming, so I hope you can give me a hint regarding the follwing.
In order to export each chart into a single image I have to use the export method:
Ausdruck.Export(Format, PathName, Interactive, PageNumber)
So, my problem is how to make the method export Diagram2D, index 4 on page 2?
How is the syntax of “Ausdruck” in this case?
March 23, 2015 at 9:35 am #9382Bernhard KantzParticipantThe document consists of a collection of pages, each containing a collection of shapes. Some of them like tables and diagrams have DocObjects associated with. The following sample enumerates the diagrams of a document and displays their name.
Sub DocuTest() Dim oDoc As Document Set oDoc = ThisDatabase.RootFolder("Dokument", fpObjectTypeDocument) Dim oShapes As Shapes For Each oShapes In oDoc.Pages Dim oShape As Shape For Each oShape In oShapes If Not oShape.DocObject Is Nothing Then If oShape.DocObject.ObjectType = fpObjectType2DDiagram _ Or oShape.DocObject.ObjectType = fpObjectType3DDiagram Then MsgBox oShape.DocObject.Name End If End If Next Next End Sub
-
AuthorPosts
- You must be logged in to reply to this topic.