AngularJS - highlight text of an existing pdf file in frontend/Browser - angularjs

I have found the library
PDF creation
With this library it is possible to create different styles of pdf documents.
My question would be if there is a possibility to mark text (and maybe add a link to this marked text) of an existing pdf file with AngularJS?
Or is there any workaround to do this?

The question is a bit too broad as is - not sure what you mean by "mark" - do you mean highlighted in some way or actually selected?
Anyhow, firstly to get to the correct page -- you can use fragment identifiers in hyperlinks to link to a specific page in a PDF via the page parameter. e.g.
page 1
page 2
If you want to highlight a specific section of a page, via a hyperlink, you can use the highlight parameter, note you must also set the page to use the highlight parameter. e.g.
page 1 - highlight
The rectangle values are integers in a coordinate system where 0,0 represents the top left, and the values are given in the order lt, rt, top, btm.
One can also open a PDF file to a "Named Destination", that is a named section in the document via the nameddest parameter. e.g.
my section
This is great as it doesn't matter if pages are inserted, removed etc as the section will always be correctly linked.
You can read about Named Destinations here and also the various Parameters for Opening PDF Files

Related

Adding Footnotes (or margin notes etc.) to The Quilljs Editor

I'm looking for a way to add footnote / endnote functionality to the QuillJS.com editor. My requirements are that the note 'text' itself can still be edited as if it were document text -- hiding it away in an attribute is probably not going to work very well.
I wonder if this can be achieved?
To take a trivial example of a document:
Here is a document text as usual1
1This is the footnote text
My guess is that the best way to achieve this would be to:
Hold the actual note text as a series of blocks (note-text blocks) at the end of the document. Each block would need a unique name.
Insert the anchors (the numbers in the main text) as either some kind of embedded object or an inline blot of some kind.
When a new note is added, add the anchor inline, and add a new "note-text" block for that anchor at the end of the document, and move the cursor there.
Have some kind of mechanism to keep the order of the notes at the end of the document in sync with the order of the note-anchors in the main text.
Make sure that the block for the note text could only be deleted if its anchor was deleted. Conversely, if an anchor is deleted, remove the note-text block.
Clicking on the note-anchor would take the cursor to the note-text block, and clicking on the number at the start of the note-block (as rendered) would take the cursor back to the anchor.
Numbering would be determined by the order of the anchors in the document.
My question (for people who have experience of extending QuillJS) is: is such a system even possible? The only module that seems to come close to this level of functionality is the better-tables module.
I would really appreciate any insights about whether such a system could be achieved or some hints about how to do it.

Can't find a referenced R File on the SEC Website?

I am attempting to understand the 2020q1 data set found here: https://www.sec.gov/dera/data/financial-statement-data-sets.html,
and am using the reference documentation inside the 2020q1 folder as a “readme” file. The reference documentation specifies that
within the Presentation (pre) data set, the “report” field is a numeric (integer) whose “value refers to the “R file” as posted
on the EDGAR Web site.” I have found no such file after extensive search, and am left with no method of interpreting the “report”
field and all associated data. Please link to the appropriate R File or guide me in the right direction for assistance if possible. Thanks!
So a point of clarification upfront, cause this confused me as well, the "R file" in question is not a script file of the R language. Instead, it simply seems to be a report file that holds the formatted data.
So after digging deeper into the readme, I found the following detail in the description for the SUB.txt data.
Note: To access the complete submission files for a given filing, please see the SEC EDGAR website. The SEC website folder HTTP(s)://www.sec.gov/Archives/edgar/data/{cik}/{accession}/ will always contain all the data sets for a given submission. To assemble the folder address to any filing referenced in the SUB data set, simply substitute {cik} with the cik field and replace {accession} with the adsh field (after removing the dash character). The following sample SQL Query provides an example of how to generate a list of addresses for filings contained in the SUB data set:
· select name,form,period, 'http(s)://www.sec.gov/Archives/edgar/data/' + ltrim(str(cik,10))+'/' + replace(adsh,'-','')+'/'+instance as url from SUBM subm order by period desc, name
Therefore, it looks like we have to correlate each "adsh" submission ID with the "cik" company ID in order to get the link we are looking for.
Doing this for the first entry of pre.txt, we get an adsh value of "0001032208-20-000006". I simply searched through sub.txt with notepad and found its associated cik of "1032208" which belongs to "SEMPRA ENERGY". Therefore, we generate the following link: http://www.sec.gov/Archives/edgar/data/1032208/000103220820000006
From there, we find a directory of files associated with the given submission. Inside is a collection of files with the prefix of "R". Simply clicking on them will open them in your browser, using the "report" and "line" fields, we can then correlate which file we want. Notice that we can add "/R{number}.htm" at the end of the link we generated to find this folder to get a given report number.
If you know what you are looking for, doing this by hand with "ctr+f" find functionality should be fine. Otherwise, you may want to open these docs in excel to generate the links for you.

Searching for React components in VS Code

Is there a way to search for content within* a component without knowing which component it is in? I'm working a new code base and I'm having a hard time identifying which components are which. If I could search for strings I see on the page ("Please click Here" for example) and get components/file results, it would make it easier to navigate the application. Is there a way to do that in VS Code?
You can do Edit, Find in files using Ctrl + Shift+f to search through text. Or You can click on search icon shown in the image below indicated as 1
There is an ellipsis on the dialog where you can include/exclude files, and other options in the search box for matching case/word and using Regex. Check below details.
2 - Indicates Refresh
3 - Collapse All
4 - Clear All
5 - Regular Expression
6 - Mention include/exclude files
7 - Match case/whole word
8 - Extend search functionality along with replacing functionality
Type shift-ctrl-F to bring up the global search. Click on the three horizontal dots (...) to bring up the rest of the dialog. In the "files to include" box, put the file type you want to include (e.g. *.jsx)

Redmine: How to link an attached file in a project from its underprojects?

Lets say I have Project A with an attached imageFile.
Then I created 10 different Projects which are underprojects of Project A.
I want to link the ImageFile of Project A to the Wiki of every underproject , so that I can see the ImageFile in the Wiki-Area of each underproject.
What im doing so far is to copy full path of the attached file of Project A in the Wiki of every underproject, like for example:
!>/attachments/download/157/schnittprofil.png!
Is there a better way to achieve that, because every time I update the imagefile, I have to renew the id-numbers of all imagefile-links in the underprojects.
Since an attachment is only actually identified by its ID and all attachments are immutable (i.e. can be changed after upload), new uploads will result in a new ID. Since multiple attachments with different IDs can have the same name, you can also not reliably find an attachment just by using its name in broad contexts.
That said, to solve your issue, you could use the include macro to include a common Wiki page in your sub-project's wiki pages which then displays the image attachment.
For that, you can create a Wiki page named e.g. Schnittprofil in your parent project where you directly upload your file. In the wiki page, just reference the image with
!schnittprofil.png!
Assuming the parent project has an identifier of project-a, you can then include the page in other wiki pages with
{{include(project-a:Schnittprofil)}}
Each time you change the page on the parent project, it will automatically also show the updated content on the child wikis. The only requirement is that the users need to be able to read the wiki of your parent project (e.g. are members of the project with the "Read wiki" permission).

rtftextbox and hyperlinks/anchors inside document

A few hours ago I found that it's really easy to display *.rtf document using standart .net 2.0 winforms control (RichTextBox). It's really cool that it can display even pictures, but for me there's one missing feature - hyperlinking.
I prepared *.rtf document with a few hyperlinks to paragraphs inside document. Then I put this file into resources and loaded to rtf property of control but unluckly, clicking on links doesn't work.
Is there possible a hack or workaround to enable hyperlinks?
EDIT:
My customer will prepare one short document (let's say one *.docx file or one *.html file).
It will contain a few chapters and we want to place small table of contents at the top of document.
The expected behaviour is that user click topic and the control scroll its content to desired place in document.
So maybe it's not about links but about bookmarking.
OK, I'll try to describe larger part of needed solution.
My customer will prepare one short document (let's say one *.docx file or one *.html file).
It will contain a few chapters and we want to place small table of contents at the top of document.
The expected behaviour is that user click topic and the control scroll its content to desired place in document.
So maybe it's not about links but about bookmarking.
How are your links formatted and is DetectUrl true?
From codeproject -> only links starting with one of the recognized protocols (http:, file:, mailto:, ftp:, https:, gopher:, nntp:, prospero:, telnet:, news:, wais:, outlook:) are recognized and reformatted.
http://www.codeproject.com/KB/edit/RichTextBoxLinks.aspx
http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.detecturls(VS.80).aspx
The microsoft article has an example on the LinkClicked event.
private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(e.LinkText);
}

Resources