I am trying to change the page size on pdf to ledger when downloading. It is staying the same See code below
//trigger download of data.pdf file
$("#download-pdf").click(function(){
dsDetails.download("pdf", "data.pdf", {
orientation:"landscape", //set page orientation to landscape
units:"mm",
format:"279,432",
title:"Opportunity Details", //add title to report
});
})
the units and format options you are using are not valid download parameters for the PDF downloader, the only available properties are orientation, title and autoTable.
The autoTable property can take any of the standard auto table options, which can be found on their git repo: https://github.com/simonbengtsson/jsPDF-AutoTable#options
At the moment it is not possible to set any jsPDF options through the params, but this will be coming in the next release
Related
Here is my problem: i have a rich text lite field, used to store a contact photo. Parameter of this field is:
- only allow for thumbnail with an image attachment name (mandatory) = ContactPhoto
Parameter of the Rich Text Lite
When the user clicks on it, a standard import dialog box (managed automatically by Notes) is open and all images type can be selected as shown here :
ScreenShot of the import dialog box
With the following code, I'm able to check the size of the photo:
Set uidoc=ws.CurrentDocument
Call uidoc.Refresh(True,True)
Set doc=uidoc.Document
oneKB = 1024
PhotoTrouve = False
Forall i In doc.Items
If i.type = Attachment Then
Set emb = doc.GetAttachment(i.values(0))
If emb.source="ContactPhoto" Then
PhotoTrouve = True
If emb.filesize > (50 * oneKB) Then
strError="The size of the photo should be less than 50 Kb."
End If
End If
End If
End Forall
If PhotoTrouve= False Then
strError="Photo is mandatory."
End If
But this is not enough. I also need to check if this is well a .jpg file. The problem is that, as this is a thumbnail, its name is ContactPhoto, without any extension and i don't know how to get the original extension of the file selected by the user (seems not to be possible).
So my question is : is it possible to force the standard dialog box of the "thumbnail rich text lite" field in order that it proposes only .jpg extension file type to the user ? How to ?
Or if not, do you know a solution to check that the original file is well a .jpg file ?
Note : even if I name the attachment CPhoto.jpg (instead of ContactPhoto) by example, the user can select all type of images, not only a jpg. The photo is saved in $FILE of the document under the name of CPhoto.jpg but I don't think that the file is finally a real .jpg format. And I absolutely need a jpg image as my final objective is then to export that image in an xml file, with the good format of jpg.
Thanks a lot for your replies and help.
Karen
You will have to translate it from C#, but code to check the file contents to see if it is a jpg can be found in this answer to a previous question on this site.
Is it possible to remove/disable the selection of the Image Rendition when selecting a picture in a custom content type?
Any User/Contributer should not be able to choose the image Rendition because it happens programmatically in the Display Template. The Picture must always be choosen as Full Size Image!
Has anyone an idea how i can set this up?
As i remember Image Renditions are implemented using query string params so you can always ignore provided by user image rendition and override it in your display template.
I imported the picture in the Item_Custom.html Template (masterpages\Display Templates\Cotrol Web Parts\Item_Custom.html) like I did in the other Templates:
<mso:ManagedPropertyMapping msdt:dt="string">'Category Image'{Category Image}:'MyCategoryImageOWSIMGE',' .... </mso:ManagedPropertyMapping>
Then Set the JS Variable:
<!--#_
var CategoryImage = $getItemValue(ctx, "Category Image");
_#-->
And manually set the Rendition ID, no matter what was choosen by the user:
<img style="visibility: visible;" src="_#= CategoryImage =#_?RenditionID=7" id="CategoryImage" onload ... >
I have a blog that uses Channel Images to upload and manage images. The content area is a WYGWAM field. I have a few sizes set up in Channel Images to allow the user to adjust the layout inside their content (landscape left, landscape right, portrait left, portrait right) when adding images to the WYGWAM content field. I then have two other sizes: thumb and gallery. These are for the image gallery that appears below the content. Thumb is set as the small preview in the field settings, and gallery is set as the big preview in the field settings. It all works great in the CP publish form.
However, when using the Safecracker form things don't work as well. I can select existing images, but when I add a photo to the content field (WYGWAM) it does not resize it properly. I do get the dialog box and options I want to choose from, but that choice is not being saved.
What happens is the image is added to the WYGWAM content using the size I have selected in the field settings as the big preview. I tested this by changing what size is selected for "big preview".
However, if I upload a new image and select a size it works fine. The issue is only with existing images (ie uploaded previously for other entries).
Is it possible to use sizes in Channel Images/safecracker/wygwam?
It was a bug in the most recent build. The developer has sent me a patched version that is working.
I am using the Picture Library SlideShow Web Part and I want to show the actual image not the preview image.
I found a solution to use JQUERY to expand the width of the preview image to the width I want on the page, but this of course ruins the quality of the image.
The actual image the was uploaded will be in a path: /Home%20Page%20Banners/Banner2.jpg
SharePoint creates a preview images and placed is in another path and renames the file, for example: /Home%20Page%20Banners/_w/Banner2_jpg.jpg
My question is how can I get the preview image to show the acutal full image that was uploaded and not the scaled down image?
Picture Library SlideShow web part class is marked a sealed, so there is no way to extend it.
But it could be customized on the client side, to be more precise functions from Slideshow library (imglib.js) could be overridden.
How to display full-sized(original) images in Picture Library Slideshow web part
The solution described below allows to display original images in Slideshow web part. In order accomplish it the function for initializing picture in slideshow should be overridden (see the code below).
Step 1. Save below JavaScript code to the file, for example in SlideshowObjectInitializer.txt and upload it to SiteAssets Library
<script type="text/javascript">
function SlideshowObjectInitializer() {
ShowPic = (function(ShowPicOrig) {
return function() {
var ssObj = arguments[0]; //SlideShow object
var curPicIdx=ssObj.index; //current picture index
ShowPicOrig.apply(this, arguments); //call original ShowPic
//apply some changes to display original picture in SlideShow control
ssObj.image.src = ssObj.linkArray[curPicIdx]; //display original image instead of web image
//change picture & container size to auto instead of fixed (by default web image size is used)
ssObj.image.setAttribute('height','100%');
ssObj.image.setAttribute('width','100%');
var cell = ssObj.cell;
cell.style.width = 'auto';
cell.style.height = 'auto';
cell.style.display = '';
var pcell = ssObj.cell.parentNode;
pcell.style.width = 'auto';
pcell.style.height = 'auto';
};
})(ShowPic);
}
ExecuteOrDelayUntilScriptLoaded(SlideshowObjectInitializer, 'imglib.js');
</script>
Step 2. Add Content Editor web part (CEWP) on page where Slideshow web part is located and in the Content Editor tool pane, under Content Link, type /SiteAssets/SlideshowObjectInitializer.txt.
For more details about customizing Slideshow web part please follow this blogpost
I have a problem uploading an image to a form field using the built in xpages fileuploader control. The form field the image is saved to is configured like explained in this blog post by Mats Knutsen: http://devxpages.blogspot.com/2011/03/display-picture-from-rich-text-field.html . I Also plan to display the image in an xpage using the template described in the blog post, like this (http://server/MyDatabase.nsf/viewunid/docunid/imageField/M2?OpenElement).
I know my fileuploader control points to the correct field in the form, since i can see the image in the document using the Lotus Notes Client after the document is created. However; the picture can not be viewed using "http://server/MyDatabase.nsf/viewunid/docunid/imageField/M2?OpenElement" at this point.
On the other hand, if I delete the field contents (the image) from the document field in the client, go back to the xpage with the fileuploader control, and uploads the image a second time, it works perfectly, and the image can be viewed using the url mentioned above.
When I access field properties after the first upload, the Data Type of my field is set to Rich Text.
The second time I upload the same image to the same field in the same document, the field properties Data Type is set to MIME Part, as it probably should have gotten the first time around as well.
Does anyone know why my file uploader control does not work the first time i upload the image, but when I edit the docuement and upload the image a second time, everything seems to be ok?
I would try to avoid uploading images into the RichText in the first place. Would it break your application if you resort to uploading the image as a regular attachment? You then can reference it using .../$File/imgfilename.jpg (using the file name used during upload - retrieved by #AttachmentNames)