Loading a rtf file in a windows store app - windows-8

I am trying to load a rtf file in a windows store app, however this file comes with a style and sometimes that style is applied and ohter times isn't. This behaviour is TOTALLY random (If I rerun the app over and over again sometimes the container I am using uses the style, other doesn't).
I am using a RichEditBox only because RichTextBlock doesn't support rtf files.
I have a RichEditBox in the MainPage.xaml
<Grid>
<RichEditBox
x:Name="InfoContentView"
VerticalAlignment="Stretch"
BorderThickness="0"
Background="{x:Null}"
Foreground="#FFFFFF"/>
</Grid>
And then I inject the rtf file like this:
this.InfoContentView.IsReadOnly = false;
this.InfoContentView.Document.SetText(Windows.UI.Text.TextSetOptions.FormatRtf,
textContent);
this.InfoContentView.IsReadOnly = true;
Textcontent is loaded from application package. I supose that works since I see the text perfectly, even links work fine.
I have tried to put the Document text before each execution to empty. Also, I have added a button to refresh the behaviour and it doesnt work in the first execution but then, after I press the button several times, it is consistent.
I only wish that the behaviour is consistent. I don't care if I have to format the file in the file or in the application.
The rtf file is quite simple and you can download the rtf file here.

Well, this is ackward. I don't know if this is a bug or if I shouldn't be doing this.
This grid was inside another grid that had Visibility = Collapsed. It turns out that if I had the Visiblity equals to collapsed and then I change it to visible it would have this random behaviour. I have hidden it using the opacity and then it works. Although with this solution I had to do some hacky stuff so I could get touches in that area when the opacity is set to 0.
I am not satisfied with my answer, but it might save someone else time. I will accept any answer that explains this behaviour.

Related

How can I set the line height of a multi-line PDF form field, and save it so it doesn't get reset by filling it?

I am having the exact same issue described in this question: Multiline pdf text box
I have a PDF that has some dotted lines that I want to convert into a fillable multi-line field. I tried the solution in the linked question, but my setting is not staying when I try to fill in the field outside of Acrobat.
When I am preparing the form inside Acrobat, I set the line height to 30 and it is lining up fine:
But when I save this PDF and then try to fill in the field outside of Acrobat, the line height setting does not stay. It gets reset every time:
It's super frustrating and I have scoured the internet looking for an answer but I have nothing yet. If someone knows what to do to get the line height looking like the first screenshot, please save my sanity.
I'm using Adobe Acrobat Pro DC 2021.001.20135 on macOS 10.14.6.
Thank you
You can't. Those settings don't "stick" when the field is cleared and there's no way to set them programmatically. It's best to simply remove the lines from the PDF.
As #joelgeraci stated, the settings don't stick.
However, if the form has to be manually fillable, removing the writing lines may not be the best idea. In this situation, it would be better to change the field's background color. When the field has no content, its background color is transparent, otherwise white. And that will cover the writing lines.

SourceTree stopped showing changes in XAML files

Under SourceTree, when you click a file on the list, it nicely shows the changes made to it.
Suddendly, my SourceTree stopped showing edits made into a XAML file. The window showing the edits is completely blank even if there are edits made to the XAML file.
Previously the edits were showing correctly but suddendly they stopped to be shown.
Is there a way to fix this somehow?
I found an answer to this.
The XAML file was very big with lot of changes and SourceTree was configured to view differences only up to a certain magnitude.
Under SourcTree, you can go Tools->Options and specify Size Limit (Text) and Size Limit (Binary) values. By increasing these values the differences in XAML are again showing.

Is there any way to prevent losing text when converting a PDF to a PNG when using <CFPDF>?

Using the following code to generate thumbnails from PDFs (ColdFusion 8):
<cfpdf
action="thumbnail"
source="#LOCAL.PathToMyPDF#"
destination="#LOCAL.ImageDestination#"
format="png"
scale="100"
resolution="high"
overwrite="true"
pages="1" />
Sometimes it works great and generates a beautiful PNG representation of the first page. However, many times, it ends up creating a PNG with none of the text that's in the PDF, or with the text mangled or background images out of arrangement.
Is there any way to prevent this? I'm open to using a non-commercial java library, if necessary.
Without looking into this too deep, I would think you are having a font problem.
Try to run that bit of code with this parameter nofonts = "true" (which removes font styling) and see if you get your text (not styled).
If that works then you may need to register your fonts in Coldfusion (so Coldfusion has access to the fonts library). If you are not sure what fonts your PDF uses then you can check file, properties and click the font tab to see the fonts your PDF uses.
Check this link for more explanation on Coldfusion and fonts.
Again, I am not sure about your server and font set up because it wasn't mentioned in your post, so this is my best guess for you...
:)

Text control that render html

Does anyone know a Windows Phone textbox control that binds to HTML property? I've used C1RichTextBox and it does the job but it's too damn slow! Please help.
The control from ComponentOne is the only one I'm aware of.
Where I've had to display HTML content in the past I've used one of the following two approaches.
Display the content in a WebBrowser control.
Manually parse the HTML and convert it into XAML controls.
The first option is appropriate when there is large amount of HTML to parse and when it is likely to vary greatly. (i.e. you can't be sure you'll only get a certain set of tags being used.)
If using the second option, be sure to consider using the HTML Agility Pack to help tidy up the HTML before parsing it.
A possible workaround is to put RichTextBox into a ScrollViewer to take advantage of the hardware accelerated control.
<ScrollViewer>
<c1:C1RichTextBox Height="1000" />
</ScrollViewer>

Adjust size of File Upload Button

I want to adjust the size of the "Browse" section seen in the file upload button in HTML. When I try to adjust the size using "size" or "width" attributes, only the whole size is reduced. But I want only the size of the "Browse" button part to be reduced and not the textbox part which displays file path. Can I do this without using CSS? If yes , how?
The file input element is notoriously difficult to style. One of the problems is that it's really a single element, even though it renders as two elements.
One approach is to obscure the entire element behind the scenes and present the user with custom elements instead. Here's an article about it. Basically the file input element is hidden and some custom elements backed by some JavaScript are handling the UI and passing the necessary information to the file input.
It is very difficult to change the appearance of the Browse button as it is typically hardwired into the browser.
However, at Quirksmode.org|Styling an input type="file", there is a long post that discusses complex CSS techniques for changing the appearance of file input elements.