How I can clean the pdf view - flutter

I have a form that makes a pdf when finished and I'm using flutter_pdfview package to view the pdf. I expect to finish the form and view the pdf, but if I want to modify something I want to see the changes, but I just see the first version of the pdf. I have this theory that if I clean the String of the path that pdfview uses to render the pdf. Maybe I could see some changes, but well I have no idea.
Thanks for your attention!

Related

Manage image deletion in a WYSIWYG editor

When an HTML editor is used and images are added from the local computer, they are uploaded to a server and a link is obtained to put it in the image src attribute. What happens when the img element is removed from the editor? How would the image be deleted from the server? In this case I understand that the image deletion event could be detected and then call a service to delete it. But what happens if the user adds a new image and leaves the page? How would it be deleted in these cases?
In both cases, if the deletion of the images is not managed, it could happen that the server is filled with unused images. How do you usually solve this problem? How is the proper way to solve this?
That's a nice question there. And yeah, for sure the server would fill up with unused images in some point. I'm not an expert on this but I'll try to suggest something so I can implement it too in my WYSIWYG editor haha. I suppose you have a custom modal for the insertion of the image. Upon clicking the button you could save the image link to an array and at SAVE || on leaving the document edit || on popstate event you could make a regex that checks the innerHTML of the editor for the specific SRC. If is not found then you could push an ajax request with the image name so you can deleteit. For sure there are more efficient and complex ways to achieve that. Such as creating text ranges and track elements on keydown - Backspace(8) / Deletekey(46).
An other way is that you could track the images that are in use. When the document is saved regex out the images in the document, push them to a db table and periodically make a check from the back end so you can delete those that are not in use.
I don't know if my suggestions are helpful or not. I just saw an interesting subject so I jumped in. Cheers mate.

Is it possible to refresh the outline view only when file is saved (and not during editing)?

I'm developing a vscode extension for a custom language and I provide symbols by registering a vscode.DocumentSymbolProvider.
I have noticed that my symbol provider is called by vscode every time the content of the current file is changed in order to refresh the outline view.
I would like to change this behaviour to refresh the outline view only when the current file is saved. Is it possible ?
There is no setting for this. If you'd like to see it supported, please file a feature request
However it's entirely up to your extension when and how to compute the outline. Your extension could cache the document symbol data and return the cached version when VS Code asks, only re-computing new document symbol data on file save

Lightbox with ashx extension

I am using the LightBox plugin to display images in modal popups. It all works great in the browser with the specified extensions - png|jpg|jpeg|gif|tiff|bmp|svg - in featherlight.min.js.
I am trying to show images with .ashx extension in the modal window. But all I get is garbled text. I can get around this by adding the .ashx extension the above list.
To make upgrades easier in the future, I would like to avoid modifying the above list and add the .ashx extension outside the featherlight.min.js file. I can't find any samples on how to do that.
Is there a way to accomplish this or I just have to modify featherlight.min.js and add the .ashx extension?
Featherlight supports content filters extension: https://github.com/noelboss/featherlight#content-filters

Repeat Image in fpdf without creating another instance

I know in PDFs one can have an image repeated (appear in the PDF more than once) without having multiple instance of the image (i.e. the image data appears in the file only once).
Is there a way to do this with fPDF? I am generating a PDF containing sheets of cards; each has artwork. The artwork, which can be 300dpi, may appear in the file thousands of times.
FPDF will only embed the image once.
From http://www.fpdf.org/en/doc/image.htm
Remark: if an image is used several times, only one copy is embedded in the file.
fPDF does this always. It checks to see if the filename has been added already and creates a reference to the original rather than re-add the image data.
I had used a report designer where this kind of reference had to be made explicitly and I erroneously expected fPDF would work similarly.

Javascript won't run on UIWebView

I am trying to run javascript on UIWebView and so far everything has been great, but I got a problem where I need to change a value in selection box, I am doing this document.getElementById('dt').selectedIndex = 5; somehow UIWebView won't change it, I can read the value perfectly, but somehow it doesn't change.
You can try to parse the HTML of the page, and change the selected value. Because the HTML is available for you when a page is loaded, it shouldn't be hard to do a replace or whatever.
If you want to use javascript, check this link