I am creating a Word document based on a template. The template contains a image in the header section which I would like to re-use elsewhere in the document.
The image is stored in the package -> word/media/myImage.jpeg so I need to somehow add a relationship to my each section that I wish to display the image again. I have attempted this successfuly manually, the question is how using the sdk 2.0.
Using the AddImagePart() method is useless as this just adds the image again which is silly as I only need one copy rather than several duplicates stored in the package.
Anyone shed some light?
My experience with the SDK 2.0 is primarily in SpreadsheetML, but assuming the same principles are used in WordprocessingML, you need to create a relationship to the existing ImagePart, by obtaining its ID (using the GetIdOfPart() method) and then calling the CreateRelationshipToPart() method on the part that will hold the secondary reference to it.
Best way is to open up the document in DocumentReflector.exe and have a look on the code generated
Eric has some blog posts about that http://blogs.msdn.com/ericwhite/
Related
I require a simple but potentially complex solution that I can't seem to find code that translates from Android for my iOS version APP.
I simply need a imageview grid such as shown here from a single web directory: https://www.youtube.com/watch?v=fIX4SnBLaZg
I have a working version on Android but can't seem to figure it out on Objective C.
My working version uses JSON to find each file in the directory and associated text, then simply adds each entry to the grid. The iOS version doesn't need to be as complicated if anyone has any examples?
Would anyone have any examples/snippets/APIs of implementing something like this into iOS?
Or even a simplified version such as only images from a directory. Simply have the thread read an entire folder from URL, file by file, and populate it in imageview's. Then once a user clicks on an image, simply view it full screen?
For your requirement you can use collection view . Please follow the below tutorial
uicollectionview-basic-tutorial
And to get images of jpg stored in bundle under folder named Images
NSArray *imagesOfjpgType = [[NSBundle mainBundle]pathsForResourcesOfType:#"jpg"
inDirectory:#"Images"];
To customize the cell to your design Please use the below code
https://stackoverflow.com/a/16579595/1142743
Also Please find sample from above tutorial which has a label below the image
https://www.dropbox.com/s/1uymyrwtx2yn9fs/RecipePhoto.zip?dl=0
I know Alfresco uses imagemagick for preview of images however I want to use imagemagick when uploading images to ALfresco. So that only compressed images are stored in repository.
Any idea how can I achieve this either my manipulating configurations of Alfresco or I need to do it with some programming?
Thanks
You have a few options. First, you could write a rule which would be triggered when objects of a certain mimetype are added to a folder. Your custom rule code could then invoke a transformation to compress the image and then delete the source file. One drawback to this approach is that the original file does exist in the repo for a time. The second drawback is that you'd have to configure it on every folder. This tutorial explains how to write a custom rule action.
The second option would be to implement a behavior. Your custom behavior code can look for a node creation event and take action when it sees one happen. When it sees an image it could then invoke a transformation and replace the original. This tutorial explains how to write custom behaviors.
The third option would be to do a much lower level extension of the node service, so that the original object never actually gets created but is first compressed. That would be much more involved than either of the options above.
With the use of the Open XML SDK 2.0, I did preformed the Reflected Code of an Excel file.
Along with other things, the Excel file has some images in some of the cells. When I run the code that was generated, the file show the images just fine.
What I need to do is to programatically inject images in place of the
images that are there now. The thing is, I cannot find where the images are at in the code that was generated. How can I figure this out? Also what is the easiest way to replace those images with new ones programmatically?
You may want to take a look at a similar question about inserting images into Excel files with OpenXML SDK: C# & OpenXML: Insert an image into an excel document.
Basically, those files are created as separate document parts. The answer I linked to should show You how to insert a new image into a document, however, in order to substitute existing images with your custom ones, you could probably just modify the binary data of appropriate ImagePart (and some other associated properties).
If You need some help with the code performing this task, let me know.
Lets say i want to develop an RSS Reader reusable component for iOS with a configuration file which can me updated by user. So my wish list is as follow:
Add the component to a new project in single click. Just like adding framework.
I also want that my source files are NOT visible to other user (developer).
And yes if there are resources associated with it should also seamlessly be added to new project.
And most importantly I want the developer to be able to adjust few parameters for my component eg specifying the URL for my RSS Reader.
In short after i am done all i want the developer to see are my header files and configuration file. Any ideas ?
You should use a fake framework as described here.
I would like to start using my own templates for iOS applications. I don't want any significant changes, but simpler things like
add/remove some boilerplate code
add some pragma mark sections
hardcode my company's name and some comments for every file
change the indentation
etc etc etc
The idea is that we will share these templates when we create apps, but at the same time we want to keep the default template files that Xcode 4 already provides. So, in the following screenshot, how can I add a "CompanyName Application" section that contains exactly the same templates (Navigation-based, View-based etc), but with my own changes?
I found that I can add a folder under /Developer/Library/Xcode/Templates/ or /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/ but I'm a bit confused with what do I need to do exactly. I would really appreciate it if you could help me with that, as I have already messed up my folders twice with no luck. Thanks!
This blog post by borealkiss has detailed instructions. For starters:
If you add your own templates, the place you should use is under the following path:
~/Library/Developer/Xcode/Templates/
The problem is that it is quite hard to create a custom template.
For example, to copy and paste the
built-in template to your place will
not show up the template on Xcode 4
until you manually change its
identifier in TemplateInfo.plist.
I just found this article from Bob McCune "Creating Custom Xcode 4 File Templates" that is exactly what I needed, so I put it here for reference.