OfficeJS PowerPoint question about Slide properties - powerpoint

It seems to me that officeJS powerpoint API is quite limited. Is there a way to get properties of a slide? For example, getting the height and width of a slide?
I have tried
let parentSlide = shape.getParentSlide().load()
await context.sync()
console.log(parentSlide)
but I also can't even see the results from console.log

Related

How to alter text of label based on if the text would overflowing - in Xamarin forms

I have a UI requirement for displaying the user name list like the ones that appear on social media posts for displaying people who liked the post.
The problem in it is the overflow thing.
if it's a single user. Simply display them.
If it's a long list and overflows the label length then out the overflowing user names has to removed and replaced with remaining user count text.
Since I search through web and found no Xamarin Forms way of doing this. I am thinking of creating a custom renderer for this and using native text measuring API to figure the text to be displayed.
Android
var textSize = paint.MeasureText(this.Control.Text);
iOS
NSAttributedString nS = new NSAttributedString(txt, font: this.Control.Font);
var textSize = nS.Size;
Am I in right path? Is there any other way of doing this?

How to display long content in wp7?

Project target on wp7.5 and above
I use a listbox to display detail information of a post in a forum.
I use a richtextbox to show the body of the post which is mixed by texts and pictures. I create a behavior and bind tje content to the RichTextBox.
But what tricks me is the RichTextBox can't display all the body. I check online, get to know the reason is the height limitations of the controls which height can not be more than 2048px.
I saw people recommend a article named The Scrollable TextBlock as a solution. But I found no way to implement this.
1 You can't put a ScrollView inside a richtextbox
2 Scrollable TextBlock only supports text, but what I want is a control which can hold both text, image.
3 can bind with text
How to solve the problem?
Just a suggestion you can use the webbrowser control in your application and for the text and images display you can generate the Run time HTML and pass to webbrowser.
you can get an idea to render your text in html form see this link
Hope it helps

Getting a WebView's total scroll size ( the size of the HTML content )

I'm trying lots of things, posted many questions here, but I still can't manage to get the minimum size needed to hold an HTML page in a Cocoa WebKit WebView.
I made a weird manipulation of the DOM where I can get an approximation of the size of the HTML contents, as you can see in the picture, I resize the window based on this, and almost works, but what I realize is this:
If the Webview is intelligent enough to show accurate scroll bars (of course it is) so how come there's no interface so the programmer can get that value? is there a way that you know of?
PS: please don't provide javascript solutions, I need to implement this from the application. Anyway an html API as Webkit should be more savvy about its content than the hosted javascript code, shouldn't it?
You need to use Javascript to get the proper height.
Adapted from: How to get height of entire document with JavaScript?
(function () {
var body = document.body,
html = document.documentElement;
return Math.max( body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight );
})();
This Javascript will give you the height of the HTML. You can inject it into the WebView like this:
NSString *height = [webView stringByEvaluatingJavaScriptFromString:#"(function(){var a=document.body,b=document.documentElement;return Math.max(a.scrollHeight,a.offsetHeight,b.clientHeight,b.scrollHeight,b.offsetHeight)})();"];
height now contains the height of the HTML as a string.
While the solution by Alec Gorge worked for me, when placing the code into the webViewDidFinishLoad delegate method, I found that at least in iOS (and probably in OSX's Webkit as well) I could get the height of the web view just as well using this code:
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
int h = webView.scrollView.contentSize.height;
self.myWebViewHeightConstraint.constant = h;
}

how to set width,height of telerik RAD Calendar

In my asp.net web site project I want to make rad calendar control smaller programmatically that get rendered by default to the browser(which is quite big for my requirement).I tried setting height and width of the control it doesn't work.How can I fix this?
RadCalendar calendar = new RadCalendar();
calendar.Width = x;
calendar.Height = y;
Panel1.Controls.Add(calendar);
Each of the Telerik Skins actually have a minimum height and width setting for the RadCalendar in order to ensure that the visual styles of the control are not broken. As you can imagine modifying the width and height to arbitrary settings could skew the look and feel of the control quite a bit. What you can do, however, is either modify one of the existing skins or create your own. This section in their online documentation covers how to change the appearance, and the specific article covers how to create a custom skin.

How to place text on top of image in ReportViewer

I feel very silly asking this, since it seems like it just should work, but I cannot make it work and cannot find anything in the documentation about this.
The problem: I'm developing an application in Visual Studio 2010 that is utilizing ReportViewer, rendering the report locally. In the report designer, I place a textbox on top of an image. This looks fine in the designer, but when rendering the report, the textbox is rendered below the image.
Now, before you suggest it, I have tried placing a textbox on top of a rectangle (or other control) with the BackgroundImage property set. This works. But: I cannot find a way to rescale the background image to fit the control. Setting a different dpi for the background image does nothing. Simply rescaling the image to a different resolution is not an option, since I eventually want to print the report.
Does anybody have a solution to this?
Not possible unless the image and text are rendered separatly.
Just think of the reporting service as a matrix such as excel and only one item can be in each space. This is also true as when the report is rendered it is realigned acordingly.

Resources